From b189409a46caea75ae21fc747e22928243561bc6 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 18 Mar 2021 09:15:13 +0100 Subject: [PATCH] broadcom/compiler: handle implicit uniform loads when optimizing constant alu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/vir_opt_constant_alu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/broadcom/compiler/vir_opt_constant_alu.c b/src/broadcom/compiler/vir_opt_constant_alu.c index 561b7af6b8a..74feb2b9c68 100644 --- a/src/broadcom/compiler/vir_opt_constant_alu.c +++ b/src/broadcom/compiler/vir_opt_constant_alu.c @@ -71,10 +71,12 @@ opt_constant_add(struct v3d_compile *c, struct qinst *inst, uint32_t *values) } /* Remove the original ALU instruction and replace it with a uniform - * load. + * load. If the original instruction loaded an implicit uniform we + * need to replicate that in the new instruction. */ struct qreg dst = inst->dst; struct qinst *mov = vir_MOV_dest(c, dst, unif); + mov->uniform = inst->uniform; vir_remove_instruction(c, inst); if (dst.file == QFILE_TEMP) c->defs[dst.index] = mov;