nir/lower_subgroups: Rename lower_shuffle to lower_relative_shuffle
This option only applies to relative shuffles (up/down/xor), and in a moment we're going to add an option to lower normal shuffles, so rename it. While we're here, rename lower_shuffle() to lower_to_shuffle() for similar reasons. Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14412>
This commit is contained in:
@@ -730,7 +730,7 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
|
||||
.ballot_components = 1,
|
||||
.lower_to_scalar = 1,
|
||||
.lower_subgroup_masks = 1,
|
||||
.lower_shuffle = 1,
|
||||
.lower_relative_shuffle = 1,
|
||||
.lower_shuffle_to_32bit = 1,
|
||||
.lower_vote_eq = 1,
|
||||
.lower_quad_broadcast_dynamic = 1,
|
||||
|
@@ -4679,7 +4679,7 @@ typedef struct nir_lower_subgroups_options {
|
||||
bool lower_vote_trivial:1;
|
||||
bool lower_vote_eq:1;
|
||||
bool lower_subgroup_masks:1;
|
||||
bool lower_shuffle:1;
|
||||
bool lower_relative_shuffle:1;
|
||||
bool lower_shuffle_to_32bit:1;
|
||||
bool lower_shuffle_to_swizzle_amd:1;
|
||||
bool lower_quad:1;
|
||||
|
@@ -225,9 +225,11 @@ lower_shuffle_to_swizzle(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
}
|
||||
}
|
||||
|
||||
/* Lowers "specialized" shuffles to a generic nir_intrinsic_shuffle. */
|
||||
|
||||
static nir_ssa_def *
|
||||
lower_shuffle(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
const nir_lower_subgroups_options *options)
|
||||
lower_to_shuffle(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
const nir_lower_subgroups_options *options)
|
||||
{
|
||||
if (intrin->intrinsic == nir_intrinsic_shuffle_xor &&
|
||||
options->lower_shuffle_to_swizzle_amd &&
|
||||
@@ -479,7 +481,7 @@ lower_dynamic_quad_broadcast(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
const nir_lower_subgroups_options *options)
|
||||
{
|
||||
if (!options->lower_quad_broadcast_dynamic_to_const)
|
||||
return lower_shuffle(b, intrin, options);
|
||||
return lower_to_shuffle(b, intrin, options);
|
||||
|
||||
nir_ssa_def *dst = NULL;
|
||||
|
||||
@@ -708,8 +710,8 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options)
|
||||
case nir_intrinsic_shuffle_xor:
|
||||
case nir_intrinsic_shuffle_up:
|
||||
case nir_intrinsic_shuffle_down:
|
||||
if (options->lower_shuffle)
|
||||
return lower_shuffle(b, intrin, options);
|
||||
if (options->lower_relative_shuffle)
|
||||
return lower_to_shuffle(b, intrin, options);
|
||||
else if (options->lower_to_scalar && intrin->num_components > 1)
|
||||
return lower_subgroup_op_to_scalar(b, intrin, options->lower_shuffle_to_32bit);
|
||||
else if (options->lower_shuffle_to_32bit && intrin->src[0].ssa->bit_size == 64)
|
||||
|
@@ -861,7 +861,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
|
||||
.ballot_components = 1,
|
||||
.lower_to_scalar = true,
|
||||
.lower_vote_trivial = !is_scalar,
|
||||
.lower_shuffle = true,
|
||||
.lower_relative_shuffle = true,
|
||||
.lower_quad_broadcast_dynamic = true,
|
||||
.lower_elect = true,
|
||||
};
|
||||
|
Reference in New Issue
Block a user