st/mesa: Use nir_const_value_for_bool() in ATIFS

Fixes: 0a179bb6e2 ("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>
This commit is contained in:
Jason Ekstrand 2022-11-11 14:58:51 -06:00 committed by Marge Bot
parent e6de164e03
commit 49d86200e5

View 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,