From fde369332bb5f2b8948229554f2f1cb85a03e476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 17 Aug 2022 23:46:38 +0200 Subject: [PATCH] Remove restrictions on VRAM addresses for depth and color --- GPU/Common/TextureCacheCommon.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index a2f727c00e..8d387218fe 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -632,6 +632,7 @@ std::vector TextureCacheCommon::GetFramebufferCandidates(const if (MatchFramebuffer(entry, framebuffer, texAddrOffset, RASTER_COLOR, &match)) { candidates.push_back(AttachCandidate{ match, entry, framebuffer, RASTER_COLOR, framebuffer->colorBindSeq }); } + match = {}; if (gstate_c.Supports(GPU_SUPPORTS_DEPTH_TEXTURE) && MatchFramebuffer(entry, framebuffer, texAddrOffset, RASTER_DEPTH, &match)) { candidates.push_back(AttachCandidate{ match, entry, framebuffer, RASTER_DEPTH, framebuffer->depthBindSeq }); } @@ -894,28 +895,6 @@ bool TextureCacheCommon::MatchFramebuffer( if (texInVRAM) { const u32 mirrorMask = 0x00600000; - // This bit controls swizzle. The swizzles at 0x00200000 and 0x00600000 are designed - // to perfectly match reading depth as color (which one to use I think might be related - // to the bpp of the color format used when rendering to it). - // It's fairly unlikely that games would screw this up since the result will be garbage so - // we use it to filter out unlikely matches. - switch (entry.addr & mirrorMask) { - case 0x00000000: - case 0x00400000: - // Don't match the depth channel with these addresses when texturing. - if (channel == RasterChannel::RASTER_DEPTH) { - return false; - } - break; - case 0x00200000: - case 0x00600000: - // Don't match the color channel with these addresses when texturing. - if (channel == RasterChannel::RASTER_COLOR) { - return false; - } - break; - } - addr &= ~mirrorMask; texaddr &= ~mirrorMask; }