st/mesa: Use nir_const_value_for_bool() in ATIFS
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 11 Nov 2022 20:58:51 +0000 (14:58 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Dec 2022 23:12:30 +0000 (23:12 +0000)
Fixes: 0a179bb6e26b ("st/mesa: Generate NIR for ATI_fragment_shader instead of TGSI.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>

src/mesa/state_tracker/st_atifs_to_nir.c

index feba0975deb6366fd8a5842e310d52d33f4d93e5..b44852cd391ee0a1c7cf1cec10d2c67784e0b851 100644 (file)
@@ -407,10 +407,10 @@ compile_instruction(struct st_translate *t,
       result = emit_dstmod(t, result, inst->DstReg[optype].dstMod);
 
       /* Do the writemask */
-      nir_const_value wrmask[4] = { 0 };
+      nir_const_value wrmask[4];
       for (int i = 0; i < 4; i++) {
-         if (inst->DstReg[optype].dstMask & (1 << i))
-            wrmask[i].b = 1;
+         bool bit = inst->DstReg[optype].dstMask & (1 << i);
+         wrmask[i] = nir_const_value_for_bool(bit, 1);
       }
 
       t->temps[dstreg] = nir_bcsel(t->b,