From 10f543d5792ec0a74688c4da3781f6f84fb2ed9d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 25 Nov 2022 12:04:28 +0100 Subject: render/vulkan: release stage buffers after command buffer completes We need to wait for the pending command buffer to complete before re-using stage buffers. Otherwise we'll overwrite the stage buffer with new contents before the texture is fully uploaded. --- include/render/vulkan.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/render/vulkan.h b/include/render/vulkan.h index 5b47e8ef..d21a7ca0 100644 --- a/include/render/vulkan.h +++ b/include/render/vulkan.h @@ -150,6 +150,8 @@ struct wlr_vk_command_buffer { uint64_t timeline_point; // Textures to destroy after the command buffer completes struct wl_list destroy_textures; // wlr_vk_texture.destroy_link + // Staging shared buffers to release after the command buffer completes + struct wl_list stage_buffers; // wlr_vk_shared_buffer.link }; #define VULKAN_COMMAND_BUFFERS_CAP 64 @@ -292,7 +294,7 @@ struct wlr_vk_allocation { // List of suballocated staging buffers. // Used to upload to/read from device local images. struct wlr_vk_shared_buffer { - struct wl_list link; // wlr_vk_renderer.stage.buffers + struct wl_list link; // wlr_vk_renderer.stage.buffers or wlr_vk_command_buffer.stage_buffers VkBuffer buffer; VkDeviceMemory memory; VkDeviceSize buf_size; -- cgit v1.2.3