From 9fcbe33533513e83388d75f08618fe49e703f06c Mon Sep 17 00:00:00 2001 From: Stephane Fontaine Date: Sun, 18 Jan 2026 15:55:24 +0400 Subject: [PATCH] fix color_range assertion when wlr_color_representation_v1 is used --- render/vulkan/pass.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/render/vulkan/pass.c b/render/vulkan/pass.c index db7a659d6..89b1d839c 100644 --- a/render/vulkan/pass.c +++ b/render/vulkan/pass.c @@ -843,18 +843,20 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass, color_range = WLR_COLOR_RANGE_LIMITED; } + struct wlr_vk_pipeline_layout_key layout = { + .filter_mode = options->filter_mode + }; + if(texture->format->is_ycbcr) { + layout.ycbcr.format = texture->format; + layout.ycbcr.range = color_range; + layout.ycbcr.encoding = color_encoding; + } + struct wlr_vk_pipeline *pipe = setup_get_or_create_pipeline( pass->render_setup, &(struct wlr_vk_pipeline_key) { .source = WLR_VK_SHADER_SOURCE_TEXTURE, - .layout = { - .ycbcr = { - .format = texture->format->is_ycbcr ? texture->format : NULL, - .encoding = color_encoding, - .range = color_range, - }, - .filter_mode = options->filter_mode, - }, + .layout = layout, .texture_transform = tex_transform, .blend_mode = !texture->has_alpha && alpha == 1.0 ? WLR_RENDER_BLEND_MODE_NONE : options->blend_mode,