add wait API call
							parent
							
								
									3bbeae7517
								
							
						
					
					
						commit
						27eeb31475
					
				|  | @ -1417,6 +1417,11 @@ REFRESHAPI void REFRESH_Submit( | |||
| 	uint32_t commandBufferCount | ||||
| ); | ||||
| 
 | ||||
| /* Waits for the previous submission to complete. */ | ||||
| REFRESHAPI void REFRESH_Wait( | ||||
| 	REFRESH_Device *device | ||||
| ); | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif /* __cplusplus */ | ||||
|  |  | |||
|  | @ -972,4 +972,13 @@ void REFRESH_Submit( | |||
|     ); | ||||
| } | ||||
| 
 | ||||
| void REFRESH_Wait( | ||||
|     REFRESH_Device *device | ||||
| ) { | ||||
|     NULL_RETURN(device); | ||||
|     device->Wait( | ||||
|         device->driverData | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| /* vim: set noexpandtab shiftwidth=8 tabstop=8: */ | ||||
|  |  | |||
|  | @ -564,6 +564,10 @@ struct REFRESH_Device | |||
|         uint32_t commandBufferCount | ||||
|     ); | ||||
| 
 | ||||
|     void(*Wait)( | ||||
|         REFRESH_Renderer *driverData | ||||
|     ); | ||||
| 
 | ||||
| 	/* Opaque pointer for the Driver */ | ||||
| 	REFRESH_Renderer *driverData; | ||||
| }; | ||||
|  | @ -622,7 +626,8 @@ struct REFRESH_Device | |||
|     ASSIGN_DRIVER_FUNC(BindComputeTextures, name) \ | ||||
|     ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \ | ||||
|     ASSIGN_DRIVER_FUNC(QueuePresent, name) \ | ||||
|     ASSIGN_DRIVER_FUNC(Submit, name) | ||||
|     ASSIGN_DRIVER_FUNC(Submit, name) \ | ||||
|     ASSIGN_DRIVER_FUNC(Wait, name) | ||||
| 
 | ||||
| typedef struct REFRESH_Driver | ||||
| { | ||||
|  |  | |||
|  | @ -8501,6 +8501,20 @@ static void VULKAN_Submit( | |||
| 	SDL_stack_free(commandBuffers); | ||||
| } | ||||
| 
 | ||||
| static void VULKAN_Wait( | ||||
|     REFRESH_Renderer *driverData | ||||
| ) { | ||||
| 	VulkanRenderer *renderer = (VulkanRenderer*) driverData; | ||||
| 
 | ||||
| 	renderer->vkWaitForFences( | ||||
| 		renderer->logicalDevice, | ||||
| 		1, | ||||
| 		&renderer->inFlightFence, | ||||
| 		VK_TRUE, | ||||
| 		UINT64_MAX | ||||
| 	); | ||||
| } | ||||
| 
 | ||||
| /* Device instantiation */ | ||||
| 
 | ||||
| static inline uint8_t VULKAN_INTERNAL_SupportsExtension( | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue