From d8121fa4a9f4bbbd6d4f3f57054650c8af34d5a2 Mon Sep 17 00:00:00 2001 From: Matt Coster Date: Wed, 25 Oct 2023 10:41:36 +0100 Subject: [PATCH] pvr: Add missing format adjustment for e5b9g9r9 Devices with the feature tpu_border_colour_enhanced don't require e5b9g9r9 formats to be encoded and instead read the channels directly as f16 values. Without this special handling, two channels were left uninitialised, leading to random test failures. Fixes: dEQP-VK.pipeline.monolithic.sampler.view_type.* .format.e5b9g9r9_ufloat_pack32.address_modes.*_clamp_to_border_* Signed-off-by: Matt Coster Acked-by: Erik Faye-Lund Part-of: --- src/imagination/vulkan/pvr_border.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/imagination/vulkan/pvr_border.c b/src/imagination/vulkan/pvr_border.c index c4a7512ff64..6f790c58516 100644 --- a/src/imagination/vulkan/pvr_border.c +++ b/src/imagination/vulkan/pvr_border.c @@ -57,11 +57,11 @@ static inline void pvr_border_color_table_pack_single( struct pvr_border_color_table_value *const dst, const union pipe_color_union *const color, const struct pvr_tex_format_description *const pvr_tex_fmt_desc, - const bool is_int) + const bool is_int, + const struct pvr_device_info *const dev_info) { - const enum pipe_format pipe_format = - is_int ? pvr_tex_fmt_desc->pipe_format_int - : pvr_tex_fmt_desc->pipe_format_float; + enum pipe_format pipe_format = is_int ? pvr_tex_fmt_desc->pipe_format_int + : pvr_tex_fmt_desc->pipe_format_float; if (pipe_format == PIPE_FORMAT_NONE) return; @@ -82,6 +82,11 @@ static inline void pvr_border_color_table_pack_single( util_format_pack_z_float(pipe_format, dst->value, color->f, 1); } } else { + if (PVR_HAS_FEATURE(dev_info, tpu_border_colour_enhanced)) { + if (pipe_format == PIPE_FORMAT_R9G9B9E5_FLOAT) + pipe_format = PIPE_FORMAT_R16G16B16A16_FLOAT; + } + util_format_pack_rgba(pipe_format, dst->value, color, 1); } } @@ -99,7 +104,8 @@ static inline void pvr_border_color_table_pack_single_compressed( pvr_border_color_table_pack_single(dst, color, pvr_tex_fmt_desc_simple, - false); + false, + dev_info); return; } @@ -150,7 +156,8 @@ pvr_border_color_table_fill_entry(struct pvr_border_color_table *const table, &entry->values[tex_format], color, pvr_get_tex_format_description(tex_format), - is_int); + is_int, + dev_info); } for (; tex_format < PVR_TEX_FORMAT_COUNT * 2; tex_format++) {