mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 14:28:05 +02:00
radv: Only run some optimizations when scalarization made progress
These passes are called to clean up after scalarization, so only call them when scalarization actually made progress. No Fossil DB changes on Strix Halo (GFX11.5) Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33979>
This commit is contained in:
parent
58020fdc01
commit
1106b0a1e2
1 changed files with 7 additions and 4 deletions
|
|
@ -1719,14 +1719,17 @@ radv_graphics_shaders_link_varyings(struct radv_shader_stage *stages, enum amd_g
|
|||
|
||||
/* Scalarize all I/O, because nir_opt_varyings and nir_opt_vectorize_io expect all I/O to be scalarized. */
|
||||
nir_variable_mode sca_mode = nir_var_shader_in;
|
||||
bool sca_progress;
|
||||
if (s != MESA_SHADER_FRAGMENT)
|
||||
sca_mode |= nir_var_shader_out;
|
||||
|
||||
NIR_PASS(_, shader, nir_lower_io_to_scalar, sca_mode, NULL, NULL);
|
||||
NIR_PASS(sca_progress, shader, nir_lower_io_to_scalar, sca_mode, NULL, NULL);
|
||||
|
||||
/* Eliminate useless vec->mov copies resulting from scalarization. */
|
||||
NIR_PASS(_, shader, nir_opt_copy_prop);
|
||||
NIR_PASS(_, shader, nir_opt_constant_folding);
|
||||
if (sca_progress) {
|
||||
/* Eliminate useless vec->mov copies resulting from scalarization. */
|
||||
NIR_PASS(_, shader, nir_opt_copy_prop);
|
||||
NIR_PASS(_, shader, nir_opt_constant_folding);
|
||||
}
|
||||
}
|
||||
|
||||
int highest_changed_producer = -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue