turnip: Fill in clear color packing for r10g11b11 and rgb9e5.
authorEric Anholt <eric@anholt.net>
Fri, 27 Sep 2019 22:24:00 +0000 (15:24 -0700)
committerJonathan Marek <jonathan@marek.ca>
Tue, 15 Oct 2019 11:56:19 +0000 (07:56 -0400)
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 <hoegsberg@google.com>
src/freedreno/vulkan/tu_formats.c

index 8b8ab968d7fef37c93f5f63024b225c5dd94bbde..7e68d6103cd1ad4d7c8f230b334bc0c781329ed9 100644 (file)
@@ -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 */