From e9b5e3530f8674842207cb58855368fea104ff38 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 6 May 2026 21:44:21 +0200 Subject: [PATCH] gallivm/nir/soa: use uint for booleans Otherwise we'll hit a LLVM assert when handling load_const: llvm/include/llvm/ADT/APInt.h:121: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' failed. Cc: mesa-stable Reviewed-by: Dave Airlie Acked-by: Adam Jackson (cherry picked from commit 4bad47e99190fb60d69d8ee04f9193827b204f9a) Part-of: --- .pick_status.json | 2 +- src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4da5d99ac64..4b5c234e61d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2754,7 +2754,7 @@ "description": "gallivm/nir/soa: use uint for booleans", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c index 9e84d0a009b..d29c8a88771 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c @@ -5894,7 +5894,7 @@ void lp_build_nir_soa_func(struct gallivm_state *gallivm, } { struct lp_type bool_type; - bool_type = lp_int_type(type); + bool_type = lp_uint_type(type); bool_type.width /= 32; lp_build_context_init(&bld.bool_bld, gallivm, bool_type); } @@ -5957,7 +5957,7 @@ void lp_build_nir_soa_func(struct gallivm_state *gallivm, } { struct lp_type bool_type; - bool_type = lp_int_type(elem_type); + bool_type = lp_uint_type(elem_type); bool_type.width /= 32; lp_build_context_init(&bld.scalar_bool_bld, gallivm, bool_type); }