diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-22 20:03:05 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-05-24 08:58:59 +0000 |
commit | 7099fa2ea409051d9c894d6bd7e4cbd9e921ec10 (patch) | |
tree | 2456ebdb2e7411c2d8c86a7508d9620fce69f445 /render | |
parent | 16dea12dae0bf3207741049c5a6dc6d4076507c0 (diff) |
render/vulkan: de-dup pipeline layout initialization
Diffstat (limited to 'render')
-rw-r--r-- | render/vulkan/renderer.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index ceb67e7a..4a7f8907 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -2405,10 +2405,9 @@ static bool init_blend_to_output_pipeline(struct wlr_vk_renderer *renderer, return true; } -static bool init_default_pipeline_layout(struct wlr_vk_renderer *renderer) { - struct wlr_vk_pipeline_layout *pipeline_layout = &renderer->default_pipeline_layout; - - if (!init_sampler(renderer, &pipeline_layout->sampler, VK_NULL_HANDLE)) { +static bool init_pipeline_layout(struct wlr_vk_renderer *renderer, + struct wlr_vk_pipeline_layout *pipeline_layout) { + if (!init_sampler(renderer, &pipeline_layout->sampler, pipeline_layout->ycbcr.conversion)) { return false; } @@ -2443,15 +2442,7 @@ static bool init_ycbcr_pipeline_layout(struct wlr_vk_renderer *renderer, return false; } - if (!init_sampler(renderer, &pipeline_layout->sampler, pipeline_layout->ycbcr.conversion)) { - return false; - } - - if (!init_tex_layouts(renderer, pipeline_layout->sampler, &pipeline_layout->ds, &pipeline_layout->vk)) { - return false; - } - - return true; + return init_pipeline_layout(renderer, pipeline_layout); } // Creates static render data, such as sampler, layouts and shader modules @@ -2461,7 +2452,7 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) { VkResult res; VkDevice dev = renderer->dev->dev; - if (!init_default_pipeline_layout(renderer)) { + if (!init_pipeline_layout(renderer, &renderer->default_pipeline_layout)) { return false; } |