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

render: remove logical presentation render target #10867

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

icculus
Copy link
Collaborator

@icculus icculus commented Sep 16, 2024

This is still totally busted even for simple cases, but here's testspriteminimal mostly working:

resize-testspriteminimal

This isn't ready to merge, but it's been radio silence for way too long, so I'm putting it in a draft PR.

I spent time trying a few different approaches:

  • Hook into the draw command queueing and adjust coords: this was a non-starter, since we'd have to diddle const data on its way through the system.
  • Hook into just the setviewport queueing: the rest of the existing system fights this.
  • Hook into each backend: lots of duplicated code and chances to get things wrong, plus all the problems from above.

The current approach tries to use a seperate SDL_RenderViewState to manage logical presentation, and this seems to work without a lot of code changes, but some math is wrong somewhere, still. There's a lot of state management that needs to be examined at the edges anyhow, like when a resize event comes through and possibly wipes out some view state, etc.

Also, if the app sets a viewport or scale of its own, it's going to cause problems, but eventually that would be managed as separate value that we just multiply in to the final calculation, but I need to get the math right on the normal codepath before I worry about that.

(eventually) Fixes #8736.

@icculus icculus added this to the 3.0 ABI milestone Sep 16, 2024
@icculus icculus self-assigned this Sep 16, 2024
@slouken
Copy link
Collaborator

slouken commented Sep 16, 2024

grin Now you know why I implemented it using a render target.

@icculus icculus force-pushed the sdl3-logical-render-restore branch 3 times, most recently from aa11ed7 to 947e9b7 Compare September 18, 2024 20:29
@icculus
Copy link
Collaborator Author

icculus commented Sep 18, 2024

Alright, now we're getting somewhere:

resize-testsprite-better

More to do, but I think this was the hard part...?

@slouken
Copy link
Collaborator

slouken commented Sep 18, 2024

Alright, now we're getting somewhere
More to do, but I think this was the hard part...?

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub-pixel rendering issue in SDL3
2 participants