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

Author: Karol Herbst <kher...@redhat.com>
Date:   Sun Jan  7 21:42:19 2018 +0100

nir: fix st_nir_assign_var_locations for patch variables

Signed-off-by: Karol Herbst <kher...@redhat.com>
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
Reviewed-by: Timothy Arceri <tarc...@itsqueeze.com>

---

 src/mesa/state_tracker/st_glsl_to_nir.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 5683dfcccc..1c5de3d5de 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -139,8 +139,12 @@ st_nir_assign_var_locations(struct exec_list *var_list, 
unsigned *size,
       }
 
       bool processed = false;
-      if (var->data.patch) {
-         unsigned patch_loc = var->data.location - VARYING_SLOT_VAR0;
+      if (var->data.patch &&
+          var->data.location != VARYING_SLOT_TESS_LEVEL_INNER &&
+          var->data.location != VARYING_SLOT_TESS_LEVEL_OUTER &&
+          var->data.location != VARYING_SLOT_BOUNDING_BOX0 &&
+          var->data.location != VARYING_SLOT_BOUNDING_BOX1) {
+         unsigned patch_loc = var->data.location - VARYING_SLOT_PATCH0;
          if (processed_patch_locs & (1 << patch_loc))
             processed = true;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to