From fb187c9c893fb507d04d594e96532770d522e76a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 6 May 2024 22:08:48 -0400 Subject: [PATCH] nir/lower_subgroups: relax ballot_type_to_uint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we can generate 32-bit scalar inverse_ballots from the boolean reduce lowering which will blow up when trying to lower the resulting inverse_ballot with the common lowering. but the assert can be quieted just fine. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir_lower_subgroups.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/nir/nir_lower_subgroups.c b/src/compiler/nir/nir_lower_subgroups.c index 999e5923fa4..6ea3b11b9ed 100644 --- a/src/compiler/nir/nir_lower_subgroups.c +++ b/src/compiler/nir/nir_lower_subgroups.c @@ -66,6 +66,11 @@ static nir_def * ballot_type_to_uint(nir_builder *b, nir_def *value, const nir_lower_subgroups_options *options) { + /* Allow internal generated ballots to pass through */ + if (value->num_components == options->ballot_components && + value->bit_size == options->ballot_bit_size) + return value; + /* Only the new-style SPIR-V subgroup instructions take a ballot result as * an argument, so we only use this on uvec4 types. */