From d34811615703a85dd82726ae91570efd4bdee2f9 Mon Sep 17 00:00:00 2001 From: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com> Date: Mon, 11 May 2026 11:42:11 -0700 Subject: [PATCH] GPU: Fix segfault when copying to Vulkan swapchain (#15543) (cherry picked from commit 76f8705c1243640c7933f05fddf75f3e16fd7dff) --- src/gpu/vulkan/SDL_gpu_vulkan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 6d5833b1b8..e8b39f1a73 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -2452,6 +2452,11 @@ static void VULKAN_INTERNAL_TrackTextureTransfer( VulkanCommandBuffer *commandBuffer, 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( texture, VulkanTexture *,