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

SDL_RenderSetLogicalSize not working as expected with metal renderer (on window resize) #2970

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.8
Reported for operating system, platform: macOS 10.13, x86_64

Comments on the original bug report:

On 2018-09-05 21:24:07 +0000, SuperZazu wrote:

Good evening,

I found a bug while using "SDL_RenderSetLogicalSize" with the Metal renderer on macOS. The bug is there on 2.0.8 and on default branch (latest changeset 12175:0061cfbdd0c5).

I've wrote a minimal code to reproduce the problem (in attachment). Please comment/uncomment the line "SDL_RenderSetLogicalSize(renderer, 160, 144);" and resize the window to notice the difference between OpenGL and Metal (the blue texture in the center of the screen is not displayed the same way).

Maybe something is wrong with the viewport?

Thank you,
Nicolas

On 2018-09-05 21:24:55 +0000, SuperZazu wrote:

Created attachment 3297
minimal code to reproduce the bug

On 2018-09-05 22:52:54 +0000, Ryan C. Gordon wrote:

I can reproduce it here, I'll take a look.

--ryan.

On 2018-09-06 19:18:33 +0000, Ryan C. Gordon wrote:

Ok, it's not the viewport, it's the Metal layer that isn't resizing...so we render the correct thing to a wrong-size backbuffer and then the OS scales it to fit.

This is now fixed by https://hg.libsdl.org/SDL/rev/c06be57c5a01, but I'm CC'ing Alex to make sure this is the correct way to handle this.

--ryan.

On 2018-09-06 21:35:15 +0000, Alex Szpakowski wrote:

If I'm understanding the issue correctly, I think it might make more sense to resize the metal layer in the Cocoa view resize callback, rather than in a custom callback.

I think the code used to do that, but it looks like this commit removed that behaviour for some reason: https://hg.libsdl.org/SDL/rev/27d81cb6e6af

On 2018-10-12 20:57:13 +0000, Alex Szpakowski wrote:

This should be fixed now I think, via https://hg.libsdl.org/SDL/rev/758d4e1222a7

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

No branches or pull requests

1 participant