GPU: Hold submit lock before waiting for device idle

This commit is contained in:
Beyley Cardellio authored and Sam Lantinga committed 2025-08-10 07:21:55 -07:00
1 parent f2df279adc
commit e699f3dca1
1 file changed
+10 -3
+10 -3
View File
@@ -10495,11 +10495,18 @@ static bool VULKAN_Wait(
VkResult result;
Sint32 i;
SDL_LockMutex(renderer->submitLock);
result = renderer->vkDeviceWaitIdle(renderer->logicalDevice);
CHECK_VULKAN_ERROR_AND_RETURN(result, vkDeviceWaitIdle, false);
SDL_LockMutex(renderer->submitLock);
if (result != VK_SUCCESS) {
if (renderer->debugMode) {
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s %s", "vkDeviceWaitIdle", VkErrorMessages(result));
}
SDL_SetError("%s %s", "vkDeviceWaitIdle", VkErrorMessages(result));
SDL_UnlockMutex(renderer->submitLock);
return false;
}
for (i = renderer->submittedCommandBufferCount - 1; i >= 0; i -= 1) {
commandBuffer = renderer->submittedCommandBuffers[i];