summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-09-27 15:24:00 -0700
committerJonathan Marek <[email protected]>2019-10-15 07:56:19 -0400
commit0ce1672a2c6f4379b8122e29baf4e6255027ee47 (patch)
tree603e51595501847d294efebee6d7568390e88faf
parent1b16c5c98ed434edc27ca1ded67988711ea7732d (diff)
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 <[email protected]>
-rw-r--r--src/freedreno/vulkan/tu_formats.c13
1 files changed, 13 insertions, 0 deletions
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 */