Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix green flashes with Burnout Dominator lens flare #16081

Merged
merged 3 commits into from
Sep 22, 2022

Conversation

hrydgard
Copy link
Owner

Fixes #16075

Checking the CLUT-usage flag is a frame too late when the buffer is just created (which does happen quite often, since we aggressively delete unused framebuffers and the lens flare is not always on screen).

Additionally, the color buffer copy to the CLUT buffer causes a resize, where we used to lose the Z buffer, so it would be gone anyway the first frame. This fixes that by copying the depth buffer in this case. Hopefully won't slow anything else down noticeably.

@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Sep 22, 2022
@hrydgard hrydgard added this to the v1.14.0 milestone Sep 22, 2022
@hrydgard hrydgard merged commit c108db0 into master Sep 22, 2022
@hrydgard hrydgard deleted the zbuffer-upload-heuristic branch September 22, 2022 09:02
if (PSP_CoreParameter().compat.flags().UploadDepthForCLUTTextures && (currentRenderVfb_->usageFlags & FB_USAGE_CLUT) != 0) {
// Set the flag, then upload memory contents to depth channel.
// Special compatibility trick for Burnout Dominator lens flares. See issue #11100
if (PSP_CoreParameter().compat.flags().UploadDepthForCLUTTextures && currentRenderVfb_->z_address > 0x04110000) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we did this only when vfb->lastFrameNewSize == gpuStats.numFlips rather than based on the z_address? Would that work?

We do PerformStencilUpload / PerformMemoryUpload when creating a framebuf, I don't think it'd be so awful to also upload depth, and might allow it to be more generic.

-[Unknown]

Copy link
Owner Author

@hrydgard hrydgard Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I could try that. I guess since this Z buffer is static, only uploading it on create/resize would work. I previously tried uploading it on create and it didn't work, but I didn't realize then that it was because the resize later ruined it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lens flare effect green flash, corrupt FMVs
2 participants