Browse Source

gpu: Vulkan on private platforms cannot make use of oldSwapchain, destroy the full swapchain on resize

Ethan Lee 1 month ago
parent
commit
2135ecdfcc
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 5 - 0
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -9915,7 +9915,12 @@ static Uint32 VULKAN_INTERNAL_RecreateSwapchain(
         }
     }
 
+#ifdef SDL_VIDEO_DRIVER_PRIVATE
+    // Private platforms also invalidate the window, so don't try to preserve the surface/swapchain
+    VULKAN_INTERNAL_DestroySwapchain(renderer, windowData);
+#else
     VULKAN_INTERNAL_DestroySwapchainImage(renderer, windowData);
+#endif
     return VULKAN_INTERNAL_CreateSwapchain(renderer, windowData);
 }