pan/midgard: Round up bytemasks when promoting uniforms
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 27 Feb 2020 14:37:28 +0000 (09:37 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 27 Feb 2020 21:02:35 +0000 (21:02 +0000)
Fixes crashes with uniform promotion in certain mixed type
circumstances.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>

src/panfrost/midgard/mir_promote_uniforms.c

index 2dbea712579a75da343a00618367df06caa63c34..2d7aabed49c05894f4b0f1b489b19332532b7d66 100644 (file)
@@ -160,7 +160,8 @@ midgard_promote_uniforms(compiler_context *ctx)
                         if (ins->load_64)
                                 mov.alu.reg_mode = midgard_reg_mode_64;
 
-                        mir_set_bytemask(&mov, mir_bytemask(ins));
+                        uint16_t rounded = mir_round_bytemask_up(mir_bytemask(ins), mov.alu.reg_mode);
+                        mir_set_bytemask(&mov, rounded);
                         mir_insert_instruction_before(ctx, ins, mov);
                 } else {
                         mir_rewrite_index_src(ctx, ins->dest, promoted);