diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-06-16 20:10:01 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-06-17 21:21:35 -0400 |
commit | 3ee0f52e09d422b497434f724b9c2e1606c02bea (patch) | |
tree | b905940fb8650f8d0fa1a748416f51c56ef8a4d7 /include | |
parent | 7c5a3afd607210263e1199ad8f3d05c154a76356 (diff) |
render/vulkan: Dynamically create texture views
Now that we are dynamically creating pipeline layouts, we need separate
texture views for each pipeline layout we choose to use with a texture.
Diffstat (limited to 'include')
-rw-r--r-- | include/render/vulkan.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/render/vulkan.h b/include/render/vulkan.h index f25d7cd5..f901f5f1 100644 --- a/include/render/vulkan.h +++ b/include/render/vulkan.h @@ -295,12 +295,24 @@ struct wlr_vk_vert_pcr_data { float uv_size[2]; }; +struct wlr_vk_texture_view { + struct wl_list link; // struct wlr_vk_texture.views + const struct wlr_vk_pipeline_layout *layout; + + VkDescriptorSet ds; + VkImageView image_view; + struct wlr_vk_descriptor_pool *ds_pool; +}; + struct wlr_vk_pipeline *setup_get_or_create_pipeline( struct wlr_vk_render_format_setup *setup, const struct wlr_vk_pipeline_key *key); struct wlr_vk_pipeline_layout *get_or_create_pipeline_layout( struct wlr_vk_renderer *renderer, const struct wlr_vk_pipeline_layout_key *key); +struct wlr_vk_texture_view *vulkan_texture_get_or_create_view( + struct wlr_vk_texture *texture, + const struct wlr_vk_pipeline_layout *layout); // Creates a vulkan renderer for the given device. struct wlr_renderer *vulkan_renderer_create_for_device(struct wlr_vk_device *dev); @@ -373,11 +385,8 @@ struct wlr_vk_texture { uint32_t mem_count; VkDeviceMemory memories[WLR_DMABUF_MAX_PLANES]; VkImage image; - VkImageView image_view; const struct wlr_vk_format *format; enum wlr_vk_texture_transform transform; - VkDescriptorSet ds; - struct wlr_vk_descriptor_pool *ds_pool; struct wlr_vk_command_buffer *last_used_cb; // to track when it can be destroyed bool dmabuf_imported; bool owned; // if dmabuf_imported: whether we have ownership of the image @@ -392,6 +401,8 @@ struct wlr_vk_texture { struct wlr_addon buffer_addon; // For DMA-BUF implicit sync interop VkSemaphore foreign_semaphores[WLR_DMABUF_MAX_PLANES]; + + struct wl_list views; // struct wlr_vk_texture_ds.link }; struct wlr_vk_texture *vulkan_get_texture(struct wlr_texture *wlr_texture); |