aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-11-25 12:04:28 +0100
committerSimon Ser <contact@emersion.fr>2022-11-28 23:50:41 +0000
commit10f543d5792ec0a74688c4da3781f6f84fb2ed9d (patch)
tree3f4982e8c9b04bd8636df1a1f715b5721a67ebd0 /include
parent2a414c896ec7a4e492d81bc758248c920b47e8d1 (diff)
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.
Diffstat (limited to 'include')
-rw-r--r--include/render/vulkan.h4
1 files changed, 3 insertions, 1 deletions
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;