From cc6eec79c2bbb3cd0508a15baaa0d07655be7b23 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Sat, 4 Apr 2026 10:06:18 +0200 Subject: [PATCH] nir/opt_uniform_subgroup: fix ballot_bit_count components ballot_bit_count_reduce expects the ballot to have 4 components causing validation failures on targets where 1 < ballot_components < 4. Fix this by padding the ballot to 4 components. Signed-off-by: Job Noorman Fixes: ae66bd1c007 ("nir/opt_uniform_subgroup: use ballot_bit_count") Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_opt_uniform_subgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_uniform_subgroup.c b/src/compiler/nir/nir_opt_uniform_subgroup.c index 11d608560b2..3f13d0e878d 100644 --- a/src/compiler/nir/nir_opt_uniform_subgroup.c +++ b/src/compiler/nir/nir_opt_uniform_subgroup.c @@ -107,7 +107,7 @@ ballot_bit_count(nir_builder *b, nir_def *ballot) { return ballot->num_components == 1 ? nir_bit_count(b, ballot) - : nir_ballot_bit_count_reduce(b, ballot); + : nir_ballot_bit_count_reduce(b, nir_pad_vec4(b, ballot)); } static nir_def *