mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	GPU: Hold submit lock before waiting for device idle
(cherry picked from commit e699f3dca1)
			
			
This commit is contained in:
		 Beyley Cardellio
					Beyley Cardellio
				
			
				
					committed by
					
						 Sam Lantinga
						Sam Lantinga
					
				
			
			
				
	
			
			
			 Sam Lantinga
						Sam Lantinga
					
				
			
						parent
						
							15cc0f5f91
						
					
				
				
					commit
					2287c43b59
				
			| @@ -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]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user