From 09eda329a225320b62f4355045ecc8c8ee543209 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 30 Jun 2025 11:34:23 -0700 Subject: [PATCH] venus: filter out vulkan video feature bits on common video formats Tested with ANV_DEBUG=video-decode,video-encode: - dEQP-VK.api.info.format_properties.* Part-of: --- src/virtio/vulkan/vn_physical_device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index 87486833f34..18d3a34e554 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -2162,14 +2162,21 @@ vn_sanitize_format_properties(VkFormat format, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT | VK_FORMAT_FEATURE_DISJOINT_BIT; - /* TODO drop this after supporting VK_EXT_rgba10x6_formats */ - if (format == VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16) { + /* TODO drop rgba10x6 after supporting VK_EXT_rgba10x6_formats */ + switch (format) { + case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: + case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: props->linearTilingFeatures &= allowed_ycbcr_feats; props->optimalTilingFeatures &= allowed_ycbcr_feats; if (props3) { props3->linearTilingFeatures &= allowed_ycbcr_feats; props3->optimalTilingFeatures &= allowed_ycbcr_feats; } + break; + default: + break; } }