Mesa (master): broadcom/compiler: handle implicit uniform loads when optimizing constant alu

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 22 12:41:49 UTC 2021


Module: Mesa
Branch: master
Commit: b189409a46caea75ae21fc747e22928243561bc6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b189409a46caea75ae21fc747e22928243561bc6

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Thu Mar 18 09:15:13 2021 +0100

broadcom/compiler: handle implicit uniform loads when optimizing constant alu

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9681>

---

 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;



More information about the mesa-commit mailing list