From d7607b6a4e72c0abc7ec9267fbf123e3439c698f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 11 Feb 2026 06:14:36 +0100 Subject: [PATCH] lavapipe: Fix features for nonsubsampled ycbcr formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Vulkan spec says about VkFormatFeatureFlagBits: If a format does not incorporate chroma downsampling (it is not a “422” or “420” format) but the implementation supports sampler Y′CBCR conversion for this format, the implementation must set VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT. Fixes: af062126ae1f26b01cad1165a4e31dc40e141b6b Signed-off-by: Benjamin Otte (cherry picked from commit 0b6dd167ac72892fa6d1c70f9903c62a29e625f7) Part-of: --- .pick_status.json | 2 +- src/gallium/frontends/lavapipe/lvp_formats.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 538159977f2..e9148d2c08c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -404,7 +404,7 @@ "description": "lavapipe: Fix features for nonsubsampled ycbcr formats", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "af062126ae1f26b01cad1165a4e31dc40e141b6b", "notes": null diff --git a/src/gallium/frontends/lavapipe/lvp_formats.c b/src/gallium/frontends/lavapipe/lvp_formats.c index 80230c85896..a78407c9952 100644 --- a/src/gallium/frontends/lavapipe/lvp_formats.c +++ b/src/gallium/frontends/lavapipe/lvp_formats.c @@ -146,14 +146,14 @@ lvp_physical_device_get_format_properties(struct lvp_physical_device *physical_d if (ycbcr_info) { if (ycbcr_info->n_planes > 1) features |= VK_FORMAT_FEATURE_DISJOINT_BIT; - else - features |= VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT; + features |= VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT | + VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT; for (uint8_t plane = 0; plane < ycbcr_info->n_planes; plane++) { const struct vk_format_ycbcr_plane *plane_info = &ycbcr_info->planes[plane]; if (plane_info->denominator_scales[0] > 1 || plane_info->denominator_scales[1] > 1) - features |= VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT; + features &= ~VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT; } /* The subsampled formats have no support for linear filters. */