Texture/Framebuffer match: Ignore stride if texHeight == 1. Fixes Ridge Racer lens flares.

This commit is contained in:
Henrik Rydgård 2022-09-22 22:11:16 +02:00
parent c76d7e844c
commit a6d6e0a3cc
2 changed files with 5 additions and 3 deletions

View File

@ -555,8 +555,9 @@ void FramebufferManagerCommon::SetDepthFrameBuffer(bool isClearingDepth) {
if (!isClearingDepth && useBufferedRendering_) {
CopyToDepthFromOverlappingFramebuffers(currentRenderVfb_);
// Special compatibility trick for Burnout Dominator lens flares. See issue #11100
if (PSP_CoreParameter().compat.flags().UploadDepthForCLUTTextures && currentRenderVfb_->z_address > 0x04110000) {
// Need to upload the first line of depth buffers, for Burnout Dominator lens flares. See issue #11100 and comments to #16081.
// Might make this more generic and upload the whole depth buffer if we find it's needed for something.
if (currentRenderVfb_->lastFrameNewSize == gpuStats.numFlips) {
// Sanity check the depth buffer pointer.
if (Memory::IsValidRange(currentRenderVfb_->z_address, currentRenderVfb_->width * 2)) {
const u16 *src = (const u16 *)Memory::GetPointerUnchecked(currentRenderVfb_->z_address);

View File

@ -1018,7 +1018,8 @@ bool TextureCacheCommon::MatchFramebuffer(
return false;
}
if (fb_stride_in_bytes != tex_stride_in_bytes) {
// Note the check for texHeight - we really don't care about a stride mismatch if texHeight == 1.
if (fb_stride_in_bytes != tex_stride_in_bytes && texHeight > 1) {
// Probably irrelevant. Although, as we shall see soon, there are exceptions.
// Burnout Dominator lens flare trick special case.
if (fb_format == GE_FORMAT_8888 && entry.format == GE_TFMT_CLUT8 && texWidth == 4 && texHeight == 1) {