nir: fix st_nir_assign_var_locations for patch variables
authorKarol Herbst <kherbst@redhat.com>
Sun, 7 Jan 2018 20:42:19 +0000 (21:42 +0100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 7 Jan 2018 23:12:53 +0000 (10:12 +1100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 5683dfcccceddf1d2299da7369d7fd8e777ed6c8..1c5de3d5def5e199d13a1aad1318b4bed6655068 100644 (file)
@@ -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;