mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 05:58:29 +00:00
GPU Vulkan: Clean up in Submit in headless mode (#12744)
This commit is contained in:
@@ -10433,7 +10433,9 @@ static bool VULKAN_Submit(
|
|||||||
Uint32 swapchainImageIndex;
|
Uint32 swapchainImageIndex;
|
||||||
VulkanTextureSubresource *swapchainTextureSubresource;
|
VulkanTextureSubresource *swapchainTextureSubresource;
|
||||||
VulkanMemorySubAllocator *allocator;
|
VulkanMemorySubAllocator *allocator;
|
||||||
bool presenting = (vulkanCommandBuffer->presentDataCount > 0);
|
bool performCleanups =
|
||||||
|
(renderer->claimedWindowCount > 0 && vulkanCommandBuffer->presentDataCount > 0) ||
|
||||||
|
renderer->claimedWindowCount == 0;
|
||||||
|
|
||||||
SDL_LockMutex(renderer->submitLock);
|
SDL_LockMutex(renderer->submitLock);
|
||||||
|
|
||||||
@@ -10456,7 +10458,7 @@ static bool VULKAN_Submit(
|
|||||||
swapchainTextureSubresource);
|
swapchainTextureSubresource);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (presenting &&
|
if (performCleanups &&
|
||||||
renderer->allocationsToDefragCount > 0 &&
|
renderer->allocationsToDefragCount > 0 &&
|
||||||
!renderer->defragInProgress) {
|
!renderer->defragInProgress) {
|
||||||
if (!VULKAN_INTERNAL_DefragmentMemory(renderer, vulkanCommandBuffer))
|
if (!VULKAN_INTERNAL_DefragmentMemory(renderer, vulkanCommandBuffer))
|
||||||
@@ -10540,8 +10542,7 @@ static bool VULKAN_Submit(
|
|||||||
(presentData->windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
|
(presentData->windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If presenting, check if we can perform any cleanups
|
if (performCleanups) {
|
||||||
if (presenting) {
|
|
||||||
for (Sint32 i = renderer->submittedCommandBufferCount - 1; i >= 0; i -= 1) {
|
for (Sint32 i = renderer->submittedCommandBufferCount - 1; i >= 0; i -= 1) {
|
||||||
vulkanResult = renderer->vkGetFenceStatus(
|
vulkanResult = renderer->vkGetFenceStatus(
|
||||||
renderer->logicalDevice,
|
renderer->logicalDevice,
|
||||||
|
Reference in New Issue
Block a user