From 0ce1672a2c6f4379b8122e29baf4e6255027ee47 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 27 Sep 2019 15:24:00 -0700 Subject: [PATCH] turnip: Fill in clear color packing for r10g11b11 and rgb9e5. Fixes assertion failures in dEQP-VK.api.image_clearing.core.clear_color_image.2d.* for these formats, though the test set as a whole is stil failing. Reviewed-by: Kristian H. Kristensen --- src/freedreno/vulkan/tu_formats.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index 8b8ab968d7f..7e68d6103cd 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -29,6 +29,7 @@ #include "registers/a6xx.xml.h" #include "util/format_r11g11b10f.h" +#include "util/format_rgb9e5.h" #include "util/format_srgb.h" #include "util/u_half.h" #include "vk_format.h" @@ -567,6 +568,18 @@ void tu_pack_clear_value(const VkClearValue *val, VkFormat format, uint32_t buf[4]) { const struct vk_format_description *desc = vk_format_description(format); + + switch (format) { + case VK_FORMAT_B10G11R11_UFLOAT_PACK32: + buf[0] = float3_to_r11g11b10f(val->color.float32); + return; + case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: + buf[0] = float3_to_rgb9e5(val->color.float32); + return; + default: + break; + } + assert(desc && desc->layout == VK_FORMAT_LAYOUT_PLAIN); /* S8_UINT is special and has no depth */ -- 2.30.2