From 6fa77feba3ec7437b57b6c4c221cde9eb07cd399 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Tue, 12 Mar 2024 05:52:53 +0100 Subject: [PATCH] Latte: Fix regression in dd7cb74 --- src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp | 2 +- src/Cafe/HW/Latte/Core/LatteTextureLegacy.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp b/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp index 8c29ccc50..d7c5408fc 100644 --- a/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp +++ b/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp @@ -618,7 +618,7 @@ bool LatteMRT::UpdateCurrentFBO() } // set effective size sint32 effectiveWidth, effectiveHeight; - depthBufferView->baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, depthBufferViewFirstSlice); + depthBufferView->baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, 0); if (rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0) { rtEffectiveSize->width = effectiveWidth; diff --git a/src/Cafe/HW/Latte/Core/LatteTextureLegacy.cpp b/src/Cafe/HW/Latte/Core/LatteTextureLegacy.cpp index b35f608cf..4e5c303c9 100644 --- a/src/Cafe/HW/Latte/Core/LatteTextureLegacy.cpp +++ b/src/Cafe/HW/Latte/Core/LatteTextureLegacy.cpp @@ -206,7 +206,11 @@ void LatteTexture_updateTexturesForStage(LatteDecompilerShader* shaderContext, u bool isDepthSampler = shaderContext->textureUsesDepthCompare[textureIndex]; // look for already existing texture - LatteTextureView* textureView = LatteTextureViewLookupCache::lookup(physAddr, width, height, depth, pitch, viewFirstMip, viewNumMips, viewFirstSlice, viewNumSlices, format, dim, isDepthSampler); + LatteTextureView* textureView; + if (isDepthSampler == false) + 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); if (!textureView) { // view not found, create a new mapping which will also create a new texture if necessary