fix autoReleaseFence race condition
parent
86099fb7ee
commit
35d90f8dcb
|
@ -9661,6 +9661,7 @@ static Refresh_CommandBuffer* VULKAN_AcquireCommandBuffer(
|
|||
commandBuffer->computeUniformBuffer = NULL;
|
||||
|
||||
commandBuffer->renderPassColorTargetCount = 0;
|
||||
commandBuffer->autoReleaseFence = 1;
|
||||
|
||||
/* Reset the command buffer here to avoid resets being called
|
||||
* from a separate thread than where the command buffer was acquired
|
||||
|
@ -10322,11 +10323,11 @@ static Refresh_Fence* VULKAN_SubmitAndAcquireFence(
|
|||
) {
|
||||
VulkanCommandBuffer *vulkanCommandBuffer;
|
||||
|
||||
VULKAN_Submit(driverData, commandBuffer);
|
||||
|
||||
vulkanCommandBuffer = (VulkanCommandBuffer*) commandBuffer;
|
||||
vulkanCommandBuffer->autoReleaseFence = 0;
|
||||
|
||||
VULKAN_Submit(driverData, commandBuffer);
|
||||
|
||||
return (Refresh_Fence*) vulkanCommandBuffer->inFlightFence;
|
||||
}
|
||||
|
||||
|
@ -10377,7 +10378,6 @@ static void VULKAN_Submit(
|
|||
|
||||
VULKAN_INTERNAL_EndCommandBuffer(renderer, vulkanCommandBuffer);
|
||||
|
||||
vulkanCommandBuffer->autoReleaseFence = 1;
|
||||
vulkanCommandBuffer->inFlightFence = VULKAN_INTERNAL_AcquireFenceFromPool(renderer);
|
||||
|
||||
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
|
||||
|
|
Loading…
Reference in New Issue