From ba6368b54d6249868f1249d84a1fa4ec21dafecd Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 8 Sep 2021 16:24:02 -0700 Subject: [PATCH] mesa/st: Don't bump locations of patch vars for !PIPE_CAP_TEXCOORD. There's no need to reserve the bottom 9 VARYING_SLOT_PATCH*, since VARYING_SLOT_TEXCOORD won't be mapped there. This helps us match up with nir_to_tgsi, which wasn't shifting down by 9 for patch. Acked-by: Gert Wollny Part-of: --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index b3594154aef..79c3d8d8359 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -74,7 +74,7 @@ st_nir_fixup_varying_slots(struct st_context *st, nir_shader *shader, assert(!st->allow_st_finalize_nir_twice); nir_foreach_variable_with_modes(var, shader, mode) { - if (var->data.location >= VARYING_SLOT_VAR0) { + if (var->data.location >= VARYING_SLOT_VAR0 && var->data.location < VARYING_SLOT_PATCH0) { var->data.location += 9; } else if (var->data.location == VARYING_SLOT_PNTC) { var->data.location = VARYING_SLOT_VAR8;