pan/midgard: Promote tilebuffer reads to 32-bit
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 25 Dec 2019 04:58:28 +0000 (23:58 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Dec 2019 22:11:08 +0000 (17:11 -0500)
Fixes (among others)
dEQP-GLES3.functional.fbo.render.shared_colorbuffer_clear.tex2d_rgba16f

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/nir/nir_lower_framebuffer.c

index e04f80766175f6eb28155b3911447bb507deb819..ffb51c4c3a17eb8a127b43d34d3d31795e7fd5ae 100644 (file)
@@ -384,6 +384,11 @@ nir_lower_framebuffer(nir_shader *shader, enum pipe_format format,
                nir_ssa_def *raw = &new->dest.ssa;
                nir_ssa_def *converted = nir_native_to_shader(&b, raw, op, format_desc, bits, homogenous_bits);
 
+               if (util_format_is_float(format))
+                  converted = nir_f2f32(&b, converted);
+               else
+                  converted = nir_i2i32(&b, converted);
+
                /* Rewrite to use the converted value */
                nir_src rewritten = nir_src_for_ssa(converted);
                nir_ssa_def_rewrite_uses_after(&intr->dest.ssa, rewritten, instr);