From 56047fb64d713512edfb89067ef2be2fb68916b1 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 19 Feb 2021 13:38:57 -0500 Subject: [PATCH] panfrost: Fix UNORM 16 rendering fp16 loses precision. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/util/pan_lower_framebuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c index df9929b..0a4b82b 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/util/pan_lower_framebuffer.c @@ -66,11 +66,12 @@ pan_unpacked_type_for_format(const struct util_format_description *desc) unreachable("Void format not renderable"); bool large = (desc->channel[c].size > 16); + bool large_norm = (desc->channel[c].size > 8); bool bit8 = (desc->channel[c].size == 8); assert(desc->channel[c].size <= 32); if (desc->channel[c].normalized) - return large ? nir_type_float32 : nir_type_float16; + return large_norm ? nir_type_float32 : nir_type_float16; switch (desc->channel[c].type) { case UTIL_FORMAT_TYPE_UNSIGNED: -- 2.7.4