Reset fence as late as possible

updatetemplate
cosmonaut 2022-02-22 21:54:32 -08:00
parent 0319c26f6a
commit a3aea0f796
1 changed files with 6 additions and 6 deletions

View File

@ -7915,6 +7915,12 @@ static VkFence VULKAN_INTERNAL_AcquireFence(
fence = renderer->availableFences[renderer->availableFenceCount - 1]; fence = renderer->availableFences[renderer->availableFenceCount - 1];
renderer->availableFenceCount -= 1; renderer->availableFenceCount -= 1;
renderer->vkResetFences(
renderer->logicalDevice,
1,
&fence
);
SDL_UnlockMutex(renderer->acquireFenceLock); SDL_UnlockMutex(renderer->acquireFenceLock);
return fence; return fence;
@ -8114,12 +8120,6 @@ static void VULKAN_INTERNAL_CleanCommandBuffer(
SDL_UnlockMutex(renderer->acquireCommandBufferLock); SDL_UnlockMutex(renderer->acquireCommandBufferLock);
renderer->vkResetFences(
renderer->logicalDevice,
1,
&commandBuffer->inFlightFence
);
SDL_LockMutex(renderer->acquireFenceLock); SDL_LockMutex(renderer->acquireFenceLock);
if (renderer->availableFenceCount == renderer->availableFenceCapacity) if (renderer->availableFenceCount == renderer->availableFenceCapacity)