GE Debugger: Normalize framebuffer texture preview#16201
Merged
hrydgard merged 7 commits intohrydgard:masterfrom Oct 11, 2022
Merged
GE Debugger: Normalize framebuffer texture preview#16201hrydgard merged 7 commits intohrydgard:masterfrom
hrydgard merged 7 commits intohrydgard:masterfrom
Conversation
This works like other backends, including D3D11. This allows us to get rid of the old implementation and reuse more code.
We can just use Draw now. Keep depth, though, since it applies scale.
Previously, we would show the render-to-texture with its original dimensions. While useful, this skewed the preview coordinates and was sometimes confusing. Additionally, depth texturing didn't preview. This pads and subsets the texture preview so it's the right size.
Note: still a separate context from Draw, since it's drawn to an entirely separate window. This stops RenderDoc from getting angry.
Rather than guessing based on size, let's show explicitly.
Owner
|
Very nice to get rid of all that d3d9-specialized code! Yeah agree that caching the offscreen surfaces probably isn't worth it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's long been confusing that the texture preview shows framebuffers at their actual size, even though the area it textures from is different (especially confusing if it's using an offset.) This also screwed up the texture preview source coordinates, since they were [0, 1] based on the correct size.
To fix this:
Since I was messing around with this, I also cleaned up the calls and made it use GL 3.3+ where available, mainly so RenderDoc will stop giving up on life if I open the GE debugger while it's attached.
It's nice to remove a bunch of lines of code every once and again. This no longer caches offscreen surfaces, which I'm no longer convinced was ever a good idea - I quickly searched and saw ANGLE, etc. don't do that. I think we (I?) just assumed because we were caching framebufs, caching offscreen surfaces was a good idea.
Because this normalizes a bunch of D3D9 code, it may fix some D3D9 bugs but I'm not specifically aware of any. Hopefully it doesn't create any either...
-[Unknown]