Преглед на файлове

GPU: Fix segfault when copying to Vulkan swapchain (#15543)

(cherry picked from commit 76f8705c1243640c7933f05fddf75f3e16fd7dff)
Evan Hemsley преди 5 дни
родител
ревизия
d348116157
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      src/gpu/vulkan/SDL_gpu_vulkan.c

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

@@ -2452,6 +2452,11 @@ static void VULKAN_INTERNAL_TrackTextureTransfer(
     VulkanCommandBuffer *commandBuffer,
     VulkanCommandBuffer *commandBuffer,
     VulkanTexture *texture)
     VulkanTexture *texture)
 {
 {
+    // Textures not managed by our allocator (i.e. the swapchain) don't need to be refcounted.
+    if (texture->usedRegion == NULL) {
+        return;
+    }
+
     TRACK_RESOURCE(
     TRACK_RESOURCE(
         texture,
         texture,
         VulkanTexture *,
         VulkanTexture *,