From 4ed50a96c9cfae1ec412057accb6a44ecd98bb08 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 16 Feb 2024 15:57:41 -0800 Subject: [PATCH] move compute reset to EndComputePass --- src/Refresh_Driver_Vulkan.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 92d8032..1083fb8 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -5178,19 +5178,6 @@ static void VULKAN_INTERNAL_EndCommandBuffer( ) { VkResult result; - /* Compute pipelines are not explicitly unbound so we have to clean up here */ - if ( commandBuffer->computeUniformBuffer != renderer->dummyComputeUniformBuffer && - commandBuffer->computeUniformBuffer != NULL - ) { - VULKAN_INTERNAL_BindUniformBuffer( - renderer, - commandBuffer, - commandBuffer->computeUniformBuffer - ); - } - commandBuffer->computeUniformBuffer = NULL; - commandBuffer->currentComputePipeline = NULL; - result = renderer->vkEndCommandBuffer( commandBuffer->commandBuffer ); @@ -8704,6 +8691,19 @@ static void VULKAN_EndComputePass( ); } } + + if ( vulkanCommandBuffer->computeUniformBuffer != renderer->dummyComputeUniformBuffer && + vulkanCommandBuffer->computeUniformBuffer != NULL) + { + VULKAN_INTERNAL_BindUniformBuffer( + renderer, + vulkanCommandBuffer, + vulkanCommandBuffer->computeUniformBuffer + ); + } + + vulkanCommandBuffer->computeUniformBuffer = NULL; + vulkanCommandBuffer->currentComputePipeline = NULL; } static void* VULKAN_MapCpuBuffer(