amd: Use inverse ballot intrinsic if available
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25123>
This commit is contained in:
@@ -623,7 +623,13 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_global_vars_to_local);
|
||||
NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
|
||||
|
||||
bool gfx7minus = device->physical_device->rad_info.gfx_level <= GFX7;
|
||||
bool has_inverse_ballot = true;
|
||||
#if LLVM_AVAILABLE
|
||||
has_inverse_ballot = !radv_use_llvm_for_stage(device, nir->info.stage) || LLVM_VERSION_MAJOR >= 17;
|
||||
#endif
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_subgroups,
|
||||
&(struct nir_lower_subgroups_options){
|
||||
.subgroup_size = subgroup_size,
|
||||
@@ -638,7 +644,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st
|
||||
.lower_quad_broadcast_dynamic_to_const = gfx7minus,
|
||||
.lower_shuffle_to_swizzle_amd = 1,
|
||||
.lower_ballot_bit_count_to_mbcnt_amd = 1,
|
||||
.lower_inverse_ballot = 1,
|
||||
.lower_inverse_ballot = !has_inverse_ballot,
|
||||
});
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_load_const_to_scalar);
|
||||
|
||||
Reference in New Issue
Block a user