v3d: move NIR compiler options to GL driver
The Vulkan driver was already creating and using its own set of options, so the ones defined in the compiler are only used with GL, which is confusing. Move them to the GL driver. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10647>
This commit is contained in:
parent
db3fa1cc8c
commit
4742300e6b
|
@ -3734,48 +3734,6 @@ nir_to_vir(struct v3d_compile *c)
|
|||
}
|
||||
}
|
||||
|
||||
const nir_shader_compiler_options v3d_nir_options = {
|
||||
.lower_add_sat = true,
|
||||
.lower_all_io_to_temps = true,
|
||||
.lower_extract_byte = true,
|
||||
.lower_extract_word = true,
|
||||
.lower_bitfield_insert_to_shifts = true,
|
||||
.lower_bitfield_extract_to_shifts = true,
|
||||
.lower_bitfield_reverse = true,
|
||||
.lower_bit_count = true,
|
||||
.lower_cs_local_id_from_index = true,
|
||||
.lower_ffract = true,
|
||||
.lower_fmod = true,
|
||||
.lower_pack_unorm_2x16 = true,
|
||||
.lower_pack_snorm_2x16 = true,
|
||||
.lower_pack_unorm_4x8 = true,
|
||||
.lower_pack_snorm_4x8 = true,
|
||||
.lower_unpack_unorm_4x8 = true,
|
||||
.lower_unpack_snorm_4x8 = true,
|
||||
.lower_pack_half_2x16 = true,
|
||||
.lower_unpack_half_2x16 = true,
|
||||
.lower_fdiv = true,
|
||||
.lower_find_lsb = true,
|
||||
.lower_ffma16 = true,
|
||||
.lower_ffma32 = true,
|
||||
.lower_ffma64 = true,
|
||||
.lower_flrp32 = true,
|
||||
.lower_fpow = true,
|
||||
.lower_fsat = true,
|
||||
.lower_fsqrt = true,
|
||||
.lower_ifind_msb = true,
|
||||
.lower_isign = true,
|
||||
.lower_ldexp = true,
|
||||
.lower_mul_high = true,
|
||||
.lower_wpos_pntc = true,
|
||||
.lower_rotate = true,
|
||||
.lower_to_scalar = true,
|
||||
.has_fsub = true,
|
||||
.has_isub = true,
|
||||
.divergence_analysis_options =
|
||||
nir_divergence_multiple_workgroup_per_compute_subgroup,
|
||||
};
|
||||
|
||||
/**
|
||||
* When demoting a shader down to single-threaded, removes the THRSW
|
||||
* instructions (one will still be inserted at v3d_vir_to_qpu() for the
|
||||
|
|
|
@ -937,8 +937,6 @@ vir_has_uniform(struct qinst *inst)
|
|||
return inst->uniform != ~0;
|
||||
}
|
||||
|
||||
extern const nir_shader_compiler_options v3d_nir_options;
|
||||
|
||||
const struct v3d_compiler *v3d_compiler_init(const struct v3d_device_info *devinfo);
|
||||
void v3d_compiler_free(const struct v3d_compiler *compiler);
|
||||
void v3d_optimize_nir(struct nir_shader *s);
|
||||
|
|
|
@ -628,6 +628,48 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
return true;
|
||||
}
|
||||
|
||||
static const nir_shader_compiler_options v3d_nir_options = {
|
||||
.lower_add_sat = true,
|
||||
.lower_all_io_to_temps = true,
|
||||
.lower_extract_byte = true,
|
||||
.lower_extract_word = true,
|
||||
.lower_bitfield_insert_to_shifts = true,
|
||||
.lower_bitfield_extract_to_shifts = true,
|
||||
.lower_bitfield_reverse = true,
|
||||
.lower_bit_count = true,
|
||||
.lower_cs_local_id_from_index = true,
|
||||
.lower_ffract = true,
|
||||
.lower_fmod = true,
|
||||
.lower_pack_unorm_2x16 = true,
|
||||
.lower_pack_snorm_2x16 = true,
|
||||
.lower_pack_unorm_4x8 = true,
|
||||
.lower_pack_snorm_4x8 = true,
|
||||
.lower_unpack_unorm_4x8 = true,
|
||||
.lower_unpack_snorm_4x8 = true,
|
||||
.lower_pack_half_2x16 = true,
|
||||
.lower_unpack_half_2x16 = true,
|
||||
.lower_fdiv = true,
|
||||
.lower_find_lsb = true,
|
||||
.lower_ffma16 = true,
|
||||
.lower_ffma32 = true,
|
||||
.lower_ffma64 = true,
|
||||
.lower_flrp32 = true,
|
||||
.lower_fpow = true,
|
||||
.lower_fsat = true,
|
||||
.lower_fsqrt = true,
|
||||
.lower_ifind_msb = true,
|
||||
.lower_isign = true,
|
||||
.lower_ldexp = true,
|
||||
.lower_mul_high = true,
|
||||
.lower_wpos_pntc = true,
|
||||
.lower_rotate = true,
|
||||
.lower_to_scalar = true,
|
||||
.has_fsub = true,
|
||||
.has_isub = true,
|
||||
.divergence_analysis_options =
|
||||
nir_divergence_multiple_workgroup_per_compute_subgroup,
|
||||
};
|
||||
|
||||
static const void *
|
||||
v3d_screen_get_compiler_options(struct pipe_screen *pscreen,
|
||||
enum pipe_shader_ir ir, unsigned shader)
|
||||
|
|
Loading…
Reference in New Issue