mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
radv: Don't call nir_opt_varyings a second time when unnecessary.
When nir_opt_varyings doesn't make progress the first time, it should not be necessary to call it a second time. No Fossil DB changes. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33880>
This commit is contained in:
parent
403b3958c1
commit
371b1bf789
1 changed files with 5 additions and 1 deletions
|
|
@ -1585,6 +1585,8 @@ radv_graphics_shaders_link_varyings(struct radv_shader_stage *stages)
|
|||
NIR_PASS(_, producer, nir_copy_prop);
|
||||
}
|
||||
|
||||
int highest_changed_producer = -1;
|
||||
|
||||
/* Optimize varyings from first to last stage. */
|
||||
for (int i = 0; i < ARRAY_SIZE(graphics_shader_order); ++i) {
|
||||
const gl_shader_stage s = graphics_shader_order[i];
|
||||
|
|
@ -1604,6 +1606,8 @@ radv_graphics_shaders_link_varyings(struct radv_shader_stage *stages)
|
|||
if (p & nir_progress_producer) {
|
||||
radv_optimize_nir_algebraic(producer, false, false);
|
||||
NIR_PASS(_, producer, nir_opt_undef);
|
||||
|
||||
highest_changed_producer = i;
|
||||
}
|
||||
if (p & nir_progress_consumer) {
|
||||
radv_optimize_nir_algebraic(consumer, false, false);
|
||||
|
|
@ -1612,7 +1616,7 @@ radv_graphics_shaders_link_varyings(struct radv_shader_stage *stages)
|
|||
}
|
||||
|
||||
/* Optimize varyings from last to first stage. */
|
||||
for (int i = ARRAY_SIZE(graphics_shader_order) - 1; i >= 0; --i) {
|
||||
for (int i = highest_changed_producer; i >= 0; --i) {
|
||||
const gl_shader_stage s = graphics_shader_order[i];
|
||||
const gl_shader_stage next = stages[s].info.next_stage;
|
||||
if (!stages[s].nir || next == MESA_SHADER_NONE || !stages[next].nir)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue