nir: Split nir_lower_subgroup_options::lower_vote_eq into two bits
On NVIDIA, we can do a vote_ieq on bool in one hardware op so we don't want that lowered. We do want to lower vote_feq and other vote_ieq, though. Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
This commit is contained in:

committed by
Marge Bot

parent
f10d768a88
commit
d5c310899a
@@ -644,6 +644,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st
|
||||
.lower_relative_shuffle = 1,
|
||||
.lower_shuffle_to_32bit = 1,
|
||||
.lower_vote_eq = 1,
|
||||
.lower_vote_bool_eq = 1,
|
||||
.lower_quad_broadcast_dynamic = 1,
|
||||
.lower_quad_broadcast_dynamic_to_const = gfx7minus,
|
||||
.lower_shuffle_to_swizzle_amd = 1,
|
||||
|
@@ -5527,6 +5527,7 @@ typedef struct nir_lower_subgroups_options {
|
||||
bool lower_to_scalar : 1;
|
||||
bool lower_vote_trivial : 1;
|
||||
bool lower_vote_eq : 1;
|
||||
bool lower_vote_bool_eq : 1;
|
||||
bool lower_first_invocation_to_ballot : 1;
|
||||
bool lower_read_first_invocation : 1;
|
||||
bool lower_subgroup_masks : 1;
|
||||
|
@@ -589,8 +589,13 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options)
|
||||
if (options->lower_vote_trivial)
|
||||
return nir_imm_true(b);
|
||||
|
||||
if (nir_src_bit_size(intrin->src[0]) == 1) {
|
||||
if (options->lower_vote_bool_eq)
|
||||
return lower_vote_eq(b, intrin);
|
||||
} else {
|
||||
if (options->lower_vote_eq)
|
||||
return lower_vote_eq(b, intrin);
|
||||
}
|
||||
|
||||
if (options->lower_to_scalar && intrin->num_components > 1)
|
||||
return lower_vote_eq_to_scalar(b, intrin);
|
||||
|
@@ -560,6 +560,7 @@ ir3_nir_post_finalize(struct ir3_shader *shader)
|
||||
.ballot_components = max_subgroup_size / 32,
|
||||
.lower_to_scalar = true,
|
||||
.lower_vote_eq = true,
|
||||
.lower_vote_bool_eq = true,
|
||||
.lower_subgroup_masks = true,
|
||||
.lower_read_invocation_to_cond = true,
|
||||
.lower_shuffle = true,
|
||||
|
@@ -254,6 +254,7 @@ const nir_lower_subgroups_options si_nir_subgroups_options = {
|
||||
.lower_subgroup_masks = true,
|
||||
.lower_vote_trivial = false,
|
||||
.lower_vote_eq = true,
|
||||
.lower_vote_bool_eq = true,
|
||||
.lower_inverse_ballot = true,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user