mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render/vulkan: wait for device to become idle in vulkan_destroy()
It's not safe to destroy any resources which might still be in-use by the GPU. Wait for any asynchronous tasks to complete before destroying everything.
This commit is contained in:
		
							parent
							
								
									f4f3c15c1e
								
							
						
					
					
						commit
						d112c2d922
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -1120,6 +1120,11 @@ static void vulkan_destroy(struct wlr_renderer *wlr_renderer) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	assert(!renderer->current_render_buffer);
 | 
						assert(!renderer->current_render_buffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						VkResult res = vkDeviceWaitIdle(renderer->dev->dev);
 | 
				
			||||||
 | 
						if (res != VK_SUCCESS) {
 | 
				
			||||||
 | 
							wlr_vk_error("vkDeviceWaitIdle", res);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// stage.cb automatically freed with command pool
 | 
						// stage.cb automatically freed with command pool
 | 
				
			||||||
	struct wlr_vk_shared_buffer *buf, *tmp_buf;
 | 
						struct wlr_vk_shared_buffer *buf, *tmp_buf;
 | 
				
			||||||
	wl_list_for_each_safe(buf, tmp_buf, &renderer->stage.buffers, link) {
 | 
						wl_list_for_each_safe(buf, tmp_buf, &renderer->stage.buffers, link) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue