diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 069c2e585f..faf8102ee1 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -9521,7 +9521,8 @@ static SDL_GPUCommandBuffer *VULKAN_AcquireCommandBuffer( VulkanCommandBuffer *commandBuffer = VULKAN_INTERNAL_GetInactiveCommandBufferFromPool(renderer, threadID); - commandBuffer->descriptorSetCache = VULKAN_INTERNAL_AcquireDescriptorSetCache(renderer); + DescriptorSetCache *descriptorSetCache = + VULKAN_INTERNAL_AcquireDescriptorSetCache(renderer); SDL_UnlockMutex(renderer->acquireCommandBufferLock); @@ -9529,6 +9530,8 @@ static SDL_GPUCommandBuffer *VULKAN_AcquireCommandBuffer( return NULL; } + commandBuffer->descriptorSetCache = descriptorSetCache; + // Reset state commandBuffer->currentComputePipeline = NULL;