mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
radv: use nir_opt_uniform_access
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17558>
This commit is contained in:
parent
fa5559f272
commit
d2754b12cd
1 changed files with 20 additions and 8 deletions
|
|
@ -4785,14 +4785,26 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout
|
|||
/* Wave and workgroup size should already be filled. */
|
||||
assert(stages[i].info.wave_size && stages[i].info.workgroup_size);
|
||||
|
||||
if (!radv_use_llvm_for_stage(device, i)) {
|
||||
nir_lower_non_uniform_access_options options = {
|
||||
.types = nir_lower_non_uniform_ubo_access | nir_lower_non_uniform_ssbo_access |
|
||||
nir_lower_non_uniform_texture_access | nir_lower_non_uniform_image_access,
|
||||
.callback = &non_uniform_access_callback,
|
||||
.callback_data = NULL,
|
||||
};
|
||||
NIR_PASS(_, stages[i].nir, nir_lower_non_uniform_access, &options);
|
||||
enum nir_lower_non_uniform_access_type lower_non_uniform_access_types =
|
||||
nir_lower_non_uniform_ubo_access | nir_lower_non_uniform_ssbo_access |
|
||||
nir_lower_non_uniform_texture_access | nir_lower_non_uniform_image_access;
|
||||
|
||||
/* In practice, most shaders do not have non-uniform-qualified
|
||||
* accesses (see
|
||||
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17558#note_1475069)
|
||||
* thus a cheaper and likely to fail check is run first.
|
||||
*/
|
||||
if (nir_has_non_uniform_access(stages[i].nir, lower_non_uniform_access_types)) {
|
||||
NIR_PASS(_, stages[i].nir, nir_opt_non_uniform_access);
|
||||
|
||||
if (!radv_use_llvm_for_stage(device, i)) {
|
||||
nir_lower_non_uniform_access_options options = {
|
||||
.types = lower_non_uniform_access_types,
|
||||
.callback = &non_uniform_access_callback,
|
||||
.callback_data = NULL,
|
||||
};
|
||||
NIR_PASS(_, stages[i].nir, nir_lower_non_uniform_access, &options);
|
||||
}
|
||||
}
|
||||
NIR_PASS(_, stages[i].nir, nir_lower_memory_model);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue