From c8feb297465d6702f293d0941b8e6d3554653a26 Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Thu, 7 May 2026 09:58:56 -0700
Subject: [PATCH] GPU: Clarify VK_KHR_maintenance9 comment
---
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 4e975a5aa5b90..b366f7211f541 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -2744,8 +2744,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;