From 1ebe9161c3f0e96e06761d3244e32440b8240db3 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 7 May 2026 09:58:56 -0700 Subject: [PATCH] GPU: Clarify VK_KHR_maintenance9 comment (cherry picked from commit c8feb297465d6702f293d0941b8e6d3554653a26) --- src/gpu/vulkan/SDL_gpu_vulkan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 7801390ba3..6d5833b1b8 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -2696,8 +2696,10 @@ static void VULKAN_INTERNAL_TextureSubresourceMemoryBarrier( memoryBarrier.subresourceRange.baseArrayLayer = textureSubresource->layer; memoryBarrier.subresourceRange.layerCount = 1; - // VK_KHR_maintenance9 adds the ability to independently transition arbitrary subsets of slices in a 3D texture, - // we need to extend the barrier layer count in order to preserve intended behaviour when that extension is enabled. + // VK_KHR_maintenance9 adds the ability to independently transition arbitrary subsets of slices in a 3D texture + // but otherwise it is not necessarily supported by the driver. + // As a workaround we have to transition the whole texture instead of just the subresource. + // If VK_KHR_maintenance9 becomes widely supported, this can be removed. // See https://docs.vulkan.org/features/latest/features/proposals/VK_KHR_maintenance9.html#_barriers_with_2d_array_compatible_3d_images if (textureSubresource->parent->container->header.info.type == SDL_GPU_TEXTURETYPE_3D) { memoryBarrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;