gallium/tgsi: add patch support to tgsi_get_gl_varying_semantic()
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 11 Dec 2017 00:45:09 +0000 (11:45 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 5 Jan 2018 00:58:55 +0000 (11:58 +1100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_from_mesa.c

index c014115918eb8aed5ae2c03a8bad18262aade9f3..659156b5190acd860ceca5fe8641231867deb7f4 100644 (file)
@@ -154,9 +154,14 @@ tgsi_get_gl_varying_semantic(gl_varying_slot attr,
    default:
       assert(attr >= VARYING_SLOT_VAR0 ||
              (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7));
-      *semantic_name = TGSI_SEMANTIC_GENERIC;
-      *semantic_index =
-         tgsi_get_generic_gl_varying_index(attr, needs_texcoord_semantic);
+      if (attr >= VARYING_SLOT_PATCH0) {
+         *semantic_name = TGSI_SEMANTIC_PATCH;
+         *semantic_index = attr - VARYING_SLOT_PATCH0;
+      } else {
+         *semantic_name = TGSI_SEMANTIC_GENERIC;
+         *semantic_index =
+            tgsi_get_generic_gl_varying_index(attr, needs_texcoord_semantic);
+      }
       break;
    }
 }