diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index cfa05e077..7790d40b2 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -2039,8 +2039,8 @@ struct wlr_vk_pipeline_layout *get_or_create_pipeline_layout( }; sampler_create_info.pNext = &conversion_info; } else { - assert(key->ycbcr.encoding == WLR_COLOR_ENCODING_NONE); - assert(key->ycbcr.range == WLR_COLOR_RANGE_NONE); + assert(key->ycbcr.encoding == WLR_COLOR_ENCODING_NONE || key->ycbcr.encoding == WLR_COLOR_ENCODING_IDENTITY); + assert(key->ycbcr.range == WLR_COLOR_RANGE_NONE || key->ycbcr.range == WLR_COLOR_RANGE_FULL); } res = vkCreateSampler(renderer->dev->dev, &sampler_create_info, NULL, &pipeline_layout->sampler); diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 19617b11f..aaf9a8d74 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -2086,8 +2086,12 @@ static enum scene_direct_scanout_result scene_entry_try_direct_scanout( return SCANOUT_INELIGIBLE; } - if (buffer->color_encoding != WLR_COLOR_ENCODING_NONE || - buffer->color_range != WLR_COLOR_RANGE_NONE) { + bool is_color_repr_none = buffer->color_encoding == WLR_COLOR_ENCODING_NONE && + buffer->color_range == WLR_COLOR_RANGE_NONE; + bool is_color_repr_identity_full = buffer->color_encoding == WLR_COLOR_ENCODING_IDENTITY && + buffer->color_range == WLR_COLOR_RANGE_FULL; + + if (!(is_color_repr_none || is_color_repr_identity_full)) { return SCANOUT_INELIGIBLE; } diff --git a/types/wlr_color_representation_v1.c b/types/wlr_color_representation_v1.c index a69ea46e5..432511b91 100644 --- a/types/wlr_color_representation_v1.c +++ b/types/wlr_color_representation_v1.c @@ -260,9 +260,11 @@ static void surface_synced_commit(struct wlr_surface_synced *synced) { "unexpected encoding/range for yuv"); } } else /* rgb */ { - wl_resource_post_error(color_repr->resource, + if (!is_identity_full) { + wl_resource_post_error(color_repr->resource, WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_PIXEL_FORMAT, "unexpected encoding/range for rgb"); + } } } @@ -465,6 +467,10 @@ struct wlr_color_representation_manager_v1 *wlr_color_representation_manager_v1_ struct wlr_color_representation_v1_coeffs_and_range coeffs_and_ranges[COEFFICIENTS_LEN * RANGES_LEN]; size_t coeffs_and_ranges_len = 0; + coeffs_and_ranges[coeffs_and_ranges_len++] = (struct wlr_color_representation_v1_coeffs_and_range){ + .coeffs = WP_COLOR_REPRESENTATION_SURFACE_V1_COEFFICIENTS_IDENTITY, + .range = WP_COLOR_REPRESENTATION_SURFACE_V1_RANGE_FULL, + }; for (size_t i = 0; i < COEFFICIENTS_LEN; i++) { enum wp_color_representation_surface_v1_coefficients coeffs = coefficients[i]; enum wlr_color_encoding enc = wlr_color_representation_v1_color_encoding_to_wlr(coeffs);