-
Notifications
You must be signed in to change notification settings - Fork 2k
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
GPU: recreate swapchain on window pixel size change event #10985
GPU: recreate swapchain on window pixel size change event #10985
Conversation
This seems good to me. We might need some locking in case something is recreating the swap chain while this event comes in on the main thread. I assume this PR obsoletes #10984? |
It actually complements that PR - they should both go in. You're right, we should lock on the window data. |
Okay, then @Akaricchi's comment on that PR is valid, and that shouldn't be merged until it's resolved. |
@slouken do the mutexes in the latest commit look good to you? If so this can go in before the other PR. |
This is good to go once CI passes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest looks good - we could maybe put the watcher in gpu.c and make a driver function to be sure all drivers are always aware of resizes but that could be done later if needed.
Yeah a NotifyResize function on sysgpu.h could be nice, but we can do that later. |
This avoids querying window size in a relatively hot function,
SDL_AcquireGPUSwapchainTexture
.Also removes a pointless Vulkan surface extent check, the limits are guaranteed by the spec.