radv: move lower_io_arrays_to_elements before lower_io_to_scalar_early
nir_lower_io_arrays_to_elements lowers arrays or matrices to elements, which ends up to vectors for matrices, but a bunch of IO optimizations only work for scalars. Calling it before lower_io_to_scalar_early allows nir_link_opt_varyings to remove duplicated inputs and replace constant inputs. fossils-db (Navi10): Totals from 294 (0.22% of 136546) affected shaders: CodeSize: 861356 -> 860224 (-0.13%); split: -0.13%, +0.00% Instrs: 161972 -> 161832 (-0.09%); split: -0.09%, +0.00% Cycles: 1185680 -> 1185120 (-0.05%); split: -0.05%, +0.00% SMEM: 31422 -> 31424 (+0.01%) Copies: 9065 -> 9068 (+0.03%) Only Talos and Dark Souls 3 are affected. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7041>
This commit is contained in:

committed by
Marge Bot

parent
b0829c6af7
commit
b32a8f83dc
@@ -2217,6 +2217,11 @@ radv_link_shaders(struct radv_pipeline *pipeline, nir_shader **shaders,
|
||||
ordered_shaders[1]->info.has_transform_feedback_varyings)
|
||||
nir_link_xfb_varyings(ordered_shaders[1], ordered_shaders[0]);
|
||||
|
||||
for (int i = 1; i < shader_count; ++i) {
|
||||
nir_lower_io_arrays_to_elements(ordered_shaders[i],
|
||||
ordered_shaders[i - 1]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < shader_count; ++i) {
|
||||
nir_variable_mode mask = 0;
|
||||
|
||||
@@ -2259,9 +2264,6 @@ radv_link_shaders(struct radv_pipeline *pipeline, nir_shader **shaders,
|
||||
}
|
||||
|
||||
for (int i = 1; !optimize_conservatively && (i < shader_count); ++i) {
|
||||
nir_lower_io_arrays_to_elements(ordered_shaders[i],
|
||||
ordered_shaders[i - 1]);
|
||||
|
||||
if (nir_link_opt_varyings(ordered_shaders[i], ordered_shaders[i - 1])) {
|
||||
nir_opt_constant_folding(ordered_shaders[i - 1]);
|
||||
nir_opt_algebraic(ordered_shaders[i - 1]);
|
||||
|
Reference in New Issue
Block a user