summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>2023-07-19 18:22:02 -0400
committerEric Engestrom <eric@engestrom.ch>2023-07-28 18:48:24 +0100
commitdfdceef33f1a90c6af1092819c551bad2be53c11 (patch)
tree280f27d2664cde3ba8981fa26d6e073af657be91
parent90d121b65bf0b49045a0a391ecac3d31a4009833 (diff)
downloadmesa-dfdceef33f1a90c6af1092819c551bad2be53c11.tar.gz
mesa-dfdceef33f1a90c6af1092819c551bad2be53c11.tar.bz2
mesa-dfdceef33f1a90c6af1092819c551bad2be53c11.zip
nir/lower_blend: Fix 32-bit logicops
nir_const_value_for_int asserts signed bounds on the input, but we pass in an unsigned value that would be out-of-bounds for 32-bit channels, causing the assert to fail for 32-bit channel formats. Fixes dEQP-VK.pipeline.monolithic.logic_op.r32_uint.* on AGXV (and probably PanVK). Fixes: dbd0615e7ad ("nir/lower_blend: Avoid useless iand with logic ops") Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24252> (cherry picked from commit 9c0740211dd67604bd42798af6d79840d3325bbe)
-rw-r--r--.pick_status.json2
-rw-r--r--src/compiler/nir/nir_lower_blend.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 95beb7e0a65..79c023de983 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1309,7 +1309,7 @@
"description": "nir/lower_blend: Fix 32-bit logicops",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "dbd0615e7ad0754ab1057cbfa810c42df971c446"
},
diff --git a/src/compiler/nir/nir_lower_blend.c b/src/compiler/nir/nir_lower_blend.c
index bfbf985fa2e..34b01e7ecf2 100644
--- a/src/compiler/nir/nir_lower_blend.c
+++ b/src/compiler/nir/nir_lower_blend.c
@@ -329,7 +329,7 @@ nir_blend_logicop(
nir_const_value mask[4];
for (int i = 0; i < 4; ++i)
- mask[i] = nir_const_value_for_int(BITFIELD_MASK(bits[i]), 32);
+ mask[i] = nir_const_value_for_uint(BITFIELD_MASK(bits[i]), 32);
nir_ssa_def *out = nir_logicop_func(b, options->logicop_func, src, dst,
nir_build_imm(b, 4, 32, mask));