|
@@ -1108,6 +1108,7 @@ typedef struct VulkanCommandBuffer
|
|
VulkanFenceHandle *inFlightFence;
|
|
VulkanFenceHandle *inFlightFence;
|
|
bool autoReleaseFence;
|
|
bool autoReleaseFence;
|
|
|
|
|
|
|
|
+ bool swapchainRequested;
|
|
bool isDefrag; // Whether this CB was created for defragging
|
|
bool isDefrag; // Whether this CB was created for defragging
|
|
} VulkanCommandBuffer;
|
|
} VulkanCommandBuffer;
|
|
|
|
|
|
@@ -9934,6 +9935,9 @@ static bool VULKAN_INTERNAL_AcquireSwapchainTexture(
|
|
SET_STRING_ERROR_AND_RETURN("Cannot acquire a swapchain texture from an unclaimed window!", false);
|
|
SET_STRING_ERROR_AND_RETURN("Cannot acquire a swapchain texture from an unclaimed window!", false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // The command buffer is flagged for cleanup when the swapchain is requested as a cleanup timing mechanism
|
|
|
|
+ vulkanCommandBuffer->swapchainRequested = true;
|
|
|
|
+
|
|
if (window->flags & SDL_WINDOW_HIDDEN) {
|
|
if (window->flags & SDL_WINDOW_HIDDEN) {
|
|
// Edge case, texture is filled in with NULL but not an error
|
|
// Edge case, texture is filled in with NULL but not an error
|
|
return true;
|
|
return true;
|
|
@@ -10392,6 +10396,7 @@ static void VULKAN_INTERNAL_CleanCommandBuffer(
|
|
commandBuffer->presentDataCount = 0;
|
|
commandBuffer->presentDataCount = 0;
|
|
commandBuffer->waitSemaphoreCount = 0;
|
|
commandBuffer->waitSemaphoreCount = 0;
|
|
commandBuffer->signalSemaphoreCount = 0;
|
|
commandBuffer->signalSemaphoreCount = 0;
|
|
|
|
+ commandBuffer->swapchainRequested = false;
|
|
|
|
|
|
// Reset defrag state
|
|
// Reset defrag state
|
|
|
|
|
|
@@ -10548,7 +10553,7 @@ static bool VULKAN_Submit(
|
|
VulkanTextureSubresource *swapchainTextureSubresource;
|
|
VulkanTextureSubresource *swapchainTextureSubresource;
|
|
VulkanMemorySubAllocator *allocator;
|
|
VulkanMemorySubAllocator *allocator;
|
|
bool performCleanups =
|
|
bool performCleanups =
|
|
- (renderer->claimedWindowCount > 0 && vulkanCommandBuffer->presentDataCount > 0) ||
|
|
|
|
|
|
+ (renderer->claimedWindowCount > 0 && vulkanCommandBuffer->swapchainRequested) ||
|
|
renderer->claimedWindowCount == 0;
|
|
renderer->claimedWindowCount == 0;
|
|
|
|
|
|
SDL_LockMutex(renderer->submitLock);
|
|
SDL_LockMutex(renderer->submitLock);
|