mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
GPU: Hold submit lock before waiting for device idle
(cherry picked from commit e699f3dca1
)
This commit is contained in:

committed by
Sam Lantinga

parent
15cc0f5f91
commit
2287c43b59
@@ -10495,11 +10495,18 @@ static bool VULKAN_Wait(
|
|||||||
VkResult result;
|
VkResult result;
|
||||||
Sint32 i;
|
Sint32 i;
|
||||||
|
|
||||||
|
SDL_LockMutex(renderer->submitLock);
|
||||||
|
|
||||||
result = renderer->vkDeviceWaitIdle(renderer->logicalDevice);
|
result = renderer->vkDeviceWaitIdle(renderer->logicalDevice);
|
||||||
|
|
||||||
CHECK_VULKAN_ERROR_AND_RETURN(result, vkDeviceWaitIdle, false);
|
if (result != VK_SUCCESS) {
|
||||||
|
if (renderer->debugMode) {
|
||||||
SDL_LockMutex(renderer->submitLock);
|
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) {
|
for (i = renderer->submittedCommandBufferCount - 1; i >= 0; i -= 1) {
|
||||||
commandBuffer = renderer->submittedCommandBuffers[i];
|
commandBuffer = renderer->submittedCommandBuffers[i];
|
||||||
|
Reference in New Issue
Block a user