From 337ef33edcbf8106c0556dda89b088e6b9c3f1d1 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 29 Nov 2022 10:19:46 +0100 Subject: render/vulkan: make shm/dmabuf split clearer in wlr_vk_format_props struct wlr_vk_format_props contains a mix of properties for shm and dmabuf, and it's not immediately clear which fields are for which kind of buffer. Use a nested struct to group the fields. --- include/render/vulkan.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include/render') diff --git a/include/render/vulkan.h b/include/render/vulkan.h index 931e5e5f..42b79bbd 100644 --- a/include/render/vulkan.h +++ b/include/render/vulkan.h @@ -96,14 +96,19 @@ struct wlr_vk_format_modifier_props { struct wlr_vk_format_props { struct wlr_vk_format format; - VkExtent2D max_extent; // relevant if not created as dma_buf - VkFormatFeatureFlags features; // relevant if not created as dma_buf - uint32_t render_mod_count; - struct wlr_vk_format_modifier_props *render_mods; + struct { + VkExtent2D max_extent; + VkFormatFeatureFlags features; + } shm; + + struct { + uint32_t render_mod_count; + struct wlr_vk_format_modifier_props *render_mods; - uint32_t texture_mod_count; - struct wlr_vk_format_modifier_props *texture_mods; + uint32_t texture_mod_count; + struct wlr_vk_format_modifier_props *texture_mods; + } dmabuf; }; void vulkan_format_props_query(struct wlr_vk_device *dev, -- cgit v1.2.3