nir/linking_helpers: remove nested IF

Just add a && to the condition. This is more readable to me.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25590>
This commit is contained in:
Rhys Perry 2023-10-05 16:45:59 +01:00 committed by Marge Bot
parent 525aacd9d7
commit c4706c6177

View file

@ -181,9 +181,9 @@ nir_remove_unused_io_vars(nir_shader *shader,
else
used = used_by_other_stage;
if (var->data.location < VARYING_SLOT_VAR0 && var->data.location >= 0)
if (shader->info.stage != MESA_SHADER_MESH || var->data.location != VARYING_SLOT_PRIMITIVE_ID)
continue;
if (var->data.location < VARYING_SLOT_VAR0 && var->data.location >= 0 &&
!(shader->info.stage == MESA_SHADER_MESH && var->data.location == VARYING_SLOT_PRIMITIVE_ID))
continue;
if (var->data.always_active_io)
continue;