mirror of
				https://git.suyu.dev/suyu/suyu.git
				synced 2025-10-31 06:46:40 +08:00 
			
		
		
		
	renderer_vulkan: bound async presentation queue growth
This commit is contained in:
		
							parent
							
								
									462ba1b360
								
							
						
					
					
						commit
						b560ade663
					
				| @ -102,8 +102,8 @@ PresentManager::PresentManager(const vk::Instance& instance_, | ||||
|       memory_allocator{memory_allocator_}, scheduler{scheduler_}, swapchain{swapchain_}, | ||||
|       surface{surface_}, blit_supported{CanBlitToSwapchain(device.GetPhysical(), | ||||
|                                                            swapchain.GetImageViewFormat())}, | ||||
|       use_present_thread{Settings::values.async_presentation.GetValue()}, | ||||
|       image_count{swapchain.GetImageCount()} { | ||||
|       use_present_thread{Settings::values.async_presentation.GetValue()} { | ||||
|     SetImageCount(); | ||||
| 
 | ||||
|     auto& dld = device.GetLogical(); | ||||
|     cmdpool = dld.CreateCommandPool({ | ||||
| @ -289,7 +289,14 @@ void PresentManager::PresentThread(std::stop_token token) { | ||||
| 
 | ||||
| void PresentManager::RecreateSwapchain(Frame* frame) { | ||||
|     swapchain.Create(*surface, frame->width, frame->height); | ||||
|     image_count = swapchain.GetImageCount(); | ||||
|     SetImageCount(); | ||||
| } | ||||
| 
 | ||||
| void PresentManager::SetImageCount() { | ||||
|     // We cannot have more than 5 images in flight at any given time.
 | ||||
|     // FRAMES_IN_FLIGHT is 7, and the cache TICKS_TO_DESTROY is 6.
 | ||||
|     // Mali drivers will give us 6.
 | ||||
|     image_count = std::min<size_t>(swapchain.GetImageCount(), 5); | ||||
| } | ||||
| 
 | ||||
| void PresentManager::CopyToSwapchain(Frame* frame) { | ||||
|  | ||||
| @ -62,6 +62,8 @@ private: | ||||
| 
 | ||||
|     void RecreateSwapchain(Frame* frame); | ||||
| 
 | ||||
|     void SetImageCount(); | ||||
| 
 | ||||
| private: | ||||
|     const vk::Instance& instance; | ||||
|     Core::Frontend::EmuWindow& render_window; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user