mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-14 10:17:54 +00:00
GPU Vulkan: Clean up in Submit in headless mode (#12744)
(cherry picked from commit 33f90f2e41)
This commit is contained in:
parent
5b052e6f8c
commit
c4fba75a12
1 changed files with 5 additions and 4 deletions
|
|
@ -10461,7 +10461,9 @@ static bool VULKAN_Submit(
|
|||
Uint32 swapchainImageIndex;
|
||||
VulkanTextureSubresource *swapchainTextureSubresource;
|
||||
VulkanMemorySubAllocator *allocator;
|
||||
bool presenting = (vulkanCommandBuffer->presentDataCount > 0);
|
||||
bool performCleanups =
|
||||
(renderer->claimedWindowCount > 0 && vulkanCommandBuffer->presentDataCount > 0) ||
|
||||
renderer->claimedWindowCount == 0;
|
||||
|
||||
SDL_LockMutex(renderer->submitLock);
|
||||
|
||||
|
|
@ -10484,7 +10486,7 @@ static bool VULKAN_Submit(
|
|||
swapchainTextureSubresource);
|
||||
}
|
||||
|
||||
if (presenting &&
|
||||
if (performCleanups &&
|
||||
renderer->allocationsToDefragCount > 0 &&
|
||||
!renderer->defragInProgress) {
|
||||
if (!VULKAN_INTERNAL_DefragmentMemory(renderer, vulkanCommandBuffer))
|
||||
|
|
@ -10568,8 +10570,7 @@ static bool VULKAN_Submit(
|
|||
(presentData->windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
|
||||
}
|
||||
|
||||
// If presenting, check if we can perform any cleanups
|
||||
if (presenting) {
|
||||
if (performCleanups) {
|
||||
for (Sint32 i = renderer->submittedCommandBufferCount - 1; i >= 0; i -= 1) {
|
||||
vulkanResult = renderer->vkGetFenceStatus(
|
||||
renderer->logicalDevice,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue