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

Reimplement framebuffer reinterpret on the new color copy framework #15892

Merged
merged 3 commits into from
Aug 24, 2022

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Aug 23, 2022

Thanks to framebuffer sequence numbers, we can now safely pretend to overlap multiple framebuffers with different formats in memory. This gets rid of "drawnFormat" and having to copy to a temporary to do reinterpret, instead we just bounce between these multiple framebuffers belonging to one address.

This makes reinterpret quite a bit faster and safer, and makes the code easier to understand and reason about, benefiting the upcoming features (32<->16 bit reinterpret, for example).

This still respects the same compat flags as before, but the goal is to get rid of them and always enable reinterpret in a later commit.

Left to do before review:

  • Reintegrate blue-to-alpha
  • Fix the texturing case where no matching framebuffer exists yet
  • Fix compatibility with float-only backends

@hrydgard hrydgard added this to the v1.14.0 milestone Aug 23, 2022
@hrydgard hrydgard added GE emulation Backend-independent GPU issues Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. labels Aug 23, 2022
@hrydgard hrydgard force-pushed the rework-reinterpret branch 2 times, most recently from 49e0a80 to b0c6082 Compare August 23, 2022 11:15
@hrydgard hrydgard marked this pull request as ready for review August 23, 2022 11:54
@hrydgard hrydgard force-pushed the rework-reinterpret branch from f023213 to ee1a3cc Compare August 24, 2022 10:04
@hrydgard hrydgard force-pushed the rework-reinterpret branch from ee1a3cc to 048a556 Compare August 24, 2022 12:40
@hrydgard hrydgard merged commit 853a2df into master Aug 24, 2022
@hrydgard hrydgard deleted the rework-reinterpret branch August 24, 2022 16:20
// OK, now resolve it so we can texture from it.
// This will do any necessary reinterprets.
CopyToColorFromOverlappingFramebuffers(vfb);
// Now we consider the resolved one the latest at the address (though really, we could make them equivalent?).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, I think equivalent would be better. Maybe it's a slightly older one. This does imply we chose it as the newest one, but there may be cases of partial overlap this gets wrong.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants