Skip to content

Commit

Permalink
Merge pull request #16084 from hrydgard/ignore-stride-with-texheight-1
Browse files Browse the repository at this point in the history
Fix Ridge Racer lens flares - ignore stride if texHeight == 1, when matching tex/fb
  • Loading branch information
hrydgard authored Sep 22, 2022
2 parents c76d7e8 + a6d6e0a commit 3db0613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion GPU/Common/TextureCacheCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3db0613

Please sign in to comment.