aboutsummaryrefslogtreecommitdiff
path: root/include/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-05 11:27:09 +0200
committerSimon Ser <contact@emersion.fr>2023-05-24 08:58:59 +0000
commitfd3876167659c254062df1cafb9303f0280bcd33 (patch)
treef80ab3f125e1d7d1441f02a31898724b96d8cdc2 /include/render
parentdb619009dcccc434efe4cc25fcd5bd6d745e0037 (diff)
render/vulkan: introduce struct wlr_vk_pipeline_layout
This will make it easier to create one pipeline layout (plus related objects) per YCbCr format.
Diffstat (limited to 'include/render')
-rw-r--r--include/render/vulkan.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/render/vulkan.h b/include/render/vulkan.h
index 202b4200..34ca8ade 100644
--- a/include/render/vulkan.h
+++ b/include/render/vulkan.h
@@ -122,6 +122,18 @@ const struct wlr_vk_format_modifier_props *vulkan_format_props_find_modifier(
struct wlr_vk_format_props *props, uint64_t mod, bool render);
void vulkan_format_props_finish(struct wlr_vk_format_props *props);
+struct wlr_vk_pipeline_layout {
+ VkPipelineLayout vk;
+ VkDescriptorSetLayout ds;
+ VkSampler sampler;
+
+ // for YCbCr pipelines only
+ struct {
+ VkSamplerYcbcrConversion conversion;
+ VkFormat format;
+ } ycbcr;
+};
+
// Constants used to pick the color transform for the texture drawing
// fragment shader. Must match those in shaders/texture.frag
enum wlr_vk_texture_transform {
@@ -194,10 +206,9 @@ struct wlr_vk_renderer {
VkShaderModule quad_frag_module;
VkShaderModule output_module;
- VkDescriptorSetLayout ds_layout, nv12_ds_layout;
- VkPipelineLayout pipe_layout, nv12_pipe_layout;
- VkSampler sampler, nv12_sampler;
- VkSamplerYcbcrConversion nv12_conversion;
+ struct wlr_vk_pipeline_layout default_pipeline_layout;
+ struct wlr_vk_pipeline_layout nv12_pipeline_layout;
+
// for blend->output subpass
VkPipelineLayout output_pipe_layout;
VkDescriptorSetLayout output_ds_layout;