From 53c439ef04a40aeb3ce8a05fb59db251228c2e8c Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 12 Jan 2024 16:02:21 -0800 Subject: [PATCH] fix multiple copy sync hazard --- src/Refresh_Driver_Vulkan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 1b3d7d5..f37196b 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -7869,6 +7869,14 @@ static void VULKAN_SetBufferData( vulkanBuffer ); + // this janky call will wait for transfer writes to finish! + VULKAN_INTERNAL_BufferMemoryBarrier( + renderer, + vulkanCommandBuffer->commandBuffer, + RESOURCE_ACCESS_TRANSFER_WRITE, + vulkanBuffer + ); + bufferCopy.srcOffset = transferBuffer->offset; bufferCopy.dstOffset = offsetInBytes; bufferCopy.size = (VkDeviceSize) dataLength;