mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-24 00:31:52 +01:00
Latte: Derive framebuffer size from correct mip of depth buffer
This commit is contained in:
parent
6fa77feba3
commit
8bc444bb97
@ -618,7 +618,7 @@ bool LatteMRT::UpdateCurrentFBO()
|
||||
}
|
||||
// set effective size
|
||||
sint32 effectiveWidth, effectiveHeight;
|
||||
depthBufferView->baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, 0);
|
||||
depthBufferView->baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, depthBufferView->firstMip);
|
||||
if (rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0)
|
||||
{
|
||||
rtEffectiveSize->width = effectiveWidth;
|
||||
|
@ -207,10 +207,10 @@ void LatteTexture_updateTexturesForStage(LatteDecompilerShader* shaderContext, u
|
||||
bool isDepthSampler = shaderContext->textureUsesDepthCompare[textureIndex];
|
||||
// look for already existing texture
|
||||
LatteTextureView* textureView;
|
||||
if (isDepthSampler == false)
|
||||
if (!isDepthSampler)
|
||||
textureView = LatteTextureViewLookupCache::lookup(physAddr, width, height, depth, pitch, viewFirstMip, viewNumMips, viewFirstSlice, viewNumSlices, format, dim);
|
||||
else
|
||||
textureView = LatteTextureViewLookupCache::lookup(physAddr, width, height, depth, pitch, viewFirstMip, viewNumMips, viewFirstSlice, viewNumSlices, format, dim, true);
|
||||
textureView = LatteTextureViewLookupCache::lookupWithColorOrDepthType(physAddr, width, height, depth, pitch, viewFirstMip, viewNumMips, viewFirstSlice, viewNumSlices, format, dim, true);
|
||||
if (!textureView)
|
||||
{
|
||||
// view not found, create a new mapping which will also create a new texture if necessary
|
||||
|
@ -143,7 +143,6 @@ void LatteTextureViewLookupCache::RemoveAll(LatteTextureView* view)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LatteTextureView* LatteTextureViewLookupCache::lookup(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim)
|
||||
{
|
||||
// todo - add tileMode param to this and the other lookup functions?
|
||||
@ -163,7 +162,7 @@ LatteTextureView* LatteTextureViewLookupCache::lookup(MPTR physAddr, sint32 widt
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
LatteTextureView* LatteTextureViewLookupCache::lookup(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim, bool isDepth)
|
||||
LatteTextureView* LatteTextureViewLookupCache::lookupWithColorOrDepthType(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim, bool isDepth)
|
||||
{
|
||||
cemu_assert_debug(firstSlice == 0);
|
||||
uint32 key = _getViewBucketKey(physAddr, width, height, pitch);
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
static void RemoveAll(LatteTextureView* view);
|
||||
|
||||
static LatteTextureView* lookup(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim);
|
||||
static LatteTextureView* lookup(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim, bool isDepth);
|
||||
static LatteTextureView* lookupWithColorOrDepthType(MPTR physAddr, sint32 width, sint32 height, sint32 depth, sint32 pitch, sint32 firstMip, sint32 numMip, sint32 firstSlice, sint32 numSlice, Latte::E_GX2SURFFMT format, Latte::E_DIM dim, bool isDepth);
|
||||
static LatteTextureView* lookupSlice(MPTR physAddr, sint32 width, sint32 height, sint32 pitch, sint32 firstMip, sint32 firstSlice, Latte::E_GX2SURFFMT format);
|
||||
static LatteTextureView* lookupSliceMinSize(MPTR physAddr, sint32 minWidth, sint32 minHeight, sint32 pitch, sint32 firstMip, sint32 firstSlice, Latte::E_GX2SURFFMT format);
|
||||
static LatteTextureView* lookupSliceEx(MPTR physAddr, sint32 width, sint32 height, sint32 pitch, sint32 firstMip, sint32 firstSlice, Latte::E_GX2SURFFMT format, bool isDepth);
|
||||
|
Loading…
Reference in New Issue
Block a user