From efd2169c1a40f552b3a6a0b03bb787255b8febf6 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 7 Jan 2018 21:42:19 +0100 Subject: [PATCH] nir: fix st_nir_assign_var_locations for patch variables Signed-off-by: Karol Herbst Reviewed-by: Kenneth Graunke Reviewed-by: Timothy Arceri --- 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 5683dfcccce..1c5de3d5def 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; -- 2.30.2