From af63185bda10036657e229c1c56e37669d04939d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 11 Nov 2022 14:58:51 -0600 Subject: [PATCH] st/mesa: Use nir_const_value_for_bool() in ATIFS Fixes: 0a179bb6e26b ("st/mesa: Generate NIR for ATI_fragment_shader instead of TGSI.") Reviewed-by: Alyssa Rosenzweig Part-of: (cherry picked from commit 49d86200e5cd8ac15c14131772644b21bf57865e) --- .pick_status.json | 2 +- src/mesa/state_tracker/st_atifs_to_nir.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ffe7f89..81e5166 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4063,7 +4063,7 @@ "description": "st/mesa: Use nir_const_value_for_bool() in ATIFS", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0a179bb6e26b487356384c561dee6aefa9af5889" }, diff --git a/src/mesa/state_tracker/st_atifs_to_nir.c b/src/mesa/state_tracker/st_atifs_to_nir.c index feba097..b44852c 100644 --- a/src/mesa/state_tracker/st_atifs_to_nir.c +++ b/src/mesa/state_tracker/st_atifs_to_nir.c @@ -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, -- 2.7.4