Kaynağa Gözat

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

Ethan Lee 4 ay önce
ebeveyn
işleme
2135ecdfcc
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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);
 }