From 252165d92543fb225bf0db415b127d95dae430f5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 5 Apr 2021 12:00:56 -0400 Subject: [PATCH] zink: lower subgroup ballot instructions this handles rewrites of ballot-related instructions/builtins to spirv vec4 types from the native GLSL U64 type Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 3b09441..0f6603a 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -961,6 +961,17 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir, NIR_PASS_V(nir, lower_work_dim); NIR_PASS_V(nir, nir_lower_regs_to_ssa); NIR_PASS_V(nir, lower_baseinstance); + + { + nir_lower_subgroups_options subgroup_options = {0}; + subgroup_options.lower_to_scalar = true; + subgroup_options.subgroup_size = screen->info.props11.subgroupSize; + subgroup_options.ballot_bit_size = 32; + subgroup_options.ballot_components = 4; + subgroup_options.lower_subgroup_masks = true; + NIR_PASS_V(nir, nir_lower_subgroups, &subgroup_options); + } + optimize_nir(nir); NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); NIR_PASS_V(nir, lower_discard_if); -- 2.7.4