lavapipe: expose planar ycbcr formats and new ycbcr features

This enables some extensions and a bunch of formats for ycbcr
support.

dEQP-VK.api.info.format_properties.g8_b8_r8_3plane_420_unorm,Fail
dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm,Fail

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
This commit is contained in:
Dave Airlie
2023-10-09 14:52:22 +10:00
committed by Marge Bot
parent e6ae51014d
commit af062126ae
5 changed files with 18 additions and 21 deletions

View File

@@ -4,6 +4,3 @@ dEQP-VK.rasterization.provoking_vertex.transform_feedback.first.line_strip_with_
dEQP-VK.rasterization.provoking_vertex.transform_feedback.per_pipeline.triangle_strip_with_adjacency,Fail
dEQP-VK.binding_model.descriptor_buffer.basic.limits,Fail
# New CTS failures in 1.3.6.3
dEQP-VK.api.info.image_format_properties.2d.linear.g8_b8r8_2plane_420_unorm,Fail

View File

@@ -129,6 +129,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
.KHR_pipeline_library = true,
.KHR_relaxed_block_layout = true,
.KHR_sampler_mirror_clamp_to_edge = true,
.KHR_sampler_ycbcr_conversion = true,
.KHR_separate_depth_stencil_layouts = true,
.KHR_shader_atomic_int64 = true,
.KHR_shader_clock = true,
@@ -212,6 +213,8 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
.EXT_transform_feedback = true,
.EXT_vertex_attribute_divisor = true,
.EXT_vertex_input_dynamic_state = true,
.EXT_ycbcr_image_arrays = true,
.EXT_ycbcr_2plane_444_formats = true,
.EXT_custom_border_color = true,
.EXT_provoking_vertex = true,
.EXT_line_rasterization = true,

View File

@@ -137,9 +137,20 @@ lvp_physical_device_get_format_properties(struct lvp_physical_device *physical_d
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
if (lvp_is_filter_minmax_format_supported(format))
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT;
if (vk_format_get_ycbcr_info(format)) {
features |= VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT |
VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT;
const struct vk_format_ycbcr_info *ycbcr_info =
vk_format_get_ycbcr_info(format);
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;
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;
}
/* The subsampled formats have no support for linear filters. */
const struct util_format_description *desc = util_format_description(pformat);

View File

@@ -676,19 +676,7 @@ lvp_vk_format_to_pipe_format(VkFormat format)
format == VK_FORMAT_R64G64B64_SFLOAT ||
format == VK_FORMAT_A2R10G10B10_SINT_PACK32 ||
format == VK_FORMAT_A2B10G10R10_SINT_PACK32 ||
format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM ||
format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
format == VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM ||
format == VK_FORMAT_G8_B8R8_2PLANE_422_UNORM ||
format == VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM ||
format == VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM ||
format == VK_FORMAT_G16_B16R16_2PLANE_420_UNORM ||
format == VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM ||
format == VK_FORMAT_G16_B16R16_2PLANE_422_UNORM ||
format == VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM ||
format == VK_FORMAT_D16_UNORM_S8_UINT ||
format == VK_FORMAT_R10X6G10X6_UNORM_2PACK16 ||
format == VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16)
format == VK_FORMAT_D16_UNORM_S8_UINT)
return PIPE_FORMAT_NONE;
return vk_format_to_pipe_format(format);

View File

@@ -1,2 +0,0 @@
# New CTS failures in 1.3.6.3
dEQP-VK.api.info.image_format_properties.2d.linear.g8_b8r8_2plane_420_unorm,Fail