-
Notifications
You must be signed in to change notification settings - Fork 2.5k
GPU Vulkan: Only modify surface on window claim or release #14659
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 Vulkan: Only modify surface on window claim or release #14659
Conversation
|
I still get the validation error. With some debug printing I narrowed it down to this call: SDL/src/gpu/vulkan/SDL_gpu_vulkan.c Lines 4607 to 4614 in 9092ddf
I think the old swapchain still exists here, because it is used later in Side note: there is a comment that says "NVIDIA + Win32 can return 0 extent when the window is minimized." I think this is always the case on Windows, not just with Nvidia, quoting the Vulkan spec on
|
|
I see... I'm trying to remember why exactly we're destroying the surface here. |
|
This problem was introduced by this patch: #14113 Before, we would always destroy the old swapchain, but now we hold on to it. |
|
IIUC the surface can just be kept alive the entire time between claiming the window and unclaiming the window, and reused with each swapchain recreation. It would only have to be destroyed when claiming the window fails, and when unclaiming the window. |
|
I believe you are correct. I'll revise this patch. |
|
The new version does not trigger the validation error. |
According to the Vulkan spec, we have to destroy swapchains before any associated surfaces.
I can't actually repro the validation error on my dev environment, so let's have the issue reporter verify the fix.
Resolves #14648