Mesa (main): mesa/st: Don't bump locations of patch vars for !PIPE_CAP_TEXCOORD.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 6 04:34:01 UTC 2021


Module: Mesa
Branch: main
Commit: ba6368b54d6249868f1249d84a1fa4ec21dafecd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba6368b54d6249868f1249d84a1fa4ec21dafecd

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Sep  8 16:24:02 2021 -0700

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 <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12800>

---

 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;



More information about the mesa-commit mailing list