[Mesa-dev] [PATCH 3/5] gallium: add new semantics for tessellation

Ilia Mirkin imirkin at alum.mit.edu
Sat Jul 19 07:59:03 PDT 2014


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---

An alternative to having TESSOUTER/INNER be separate is to create a single
TESSFACTOR semantic with index 0 being the outer, and index 1 being the
inner. I'm pretty ambivalent on the issue though.

 src/gallium/auxiliary/tgsi/tgsi_strings.c  |  4 ++++
 src/gallium/docs/source/tgsi.rst           | 31 ++++++++++++++++++++++++++++++
 src/gallium/include/pipe/p_shader_tokens.h |  6 +++++-
 3 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c
index 000df42..37c050b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
@@ -88,6 +88,10 @@ const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
    "SAMPLEPOS",
    "SAMPLEMASK",
    "INVOCATIONID",
+   "PATCH",
+   "TESSCOORD",
+   "TESSOUTER",
+   "TESSINNER",
 };
 
 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 093bf7d..d95e941 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -2754,6 +2754,37 @@ For geometry shaders, this semantic label indicates that a system value
 contains the current invocation id (i.e. gl_InvocationID). Only the X value is
 used.
 
+TGSI_SEMANTIC_PATCH
+"""""""""""""""""""
+
+For tessellation evaluation/control shaders, this semantic label indicates a
+generic per-patch attribute. Such semantics will not implicitly be per-vertex
+arrays.
+
+TGSI_SEMANTIC_TESSCOORD
+"""""""""""""""""""""""
+
+For tessellation evaluation shaders, this semantic label indicates the
+coordinates of the vertex being processed. This is available in XYZ; W is
+undefined.
+
+TGSI_SEMANTIC_TESSOUTER
+"""""""""""""""""""""""
+
+For tessellation evaluation/control shaders, this semantic label indicates the
+outer tessellation levels of the patch. Isoline tessellation will only have XY
+defined, triangle will have XYZ and quads will have XYZW defined. This
+corresponds to gl_TessLevelOuter.
+
+TGSI_SEMANTIC_TESSINNER
+"""""""""""""""""""""""
+
+For tessellation evaluation/control shaders, this semantic label indicates the
+inner tessellation levels of the patch. The X value is only defined for
+triangle tessellation, while quads will have XY defined. This is entirely
+undefined for isoline tessellation.
+
+
 Declaration Interpolate
 ^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 01a8128..5e98c60 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -178,7 +178,11 @@ struct tgsi_declaration_interp
 #define TGSI_SEMANTIC_SAMPLEPOS  25
 #define TGSI_SEMANTIC_SAMPLEMASK 26
 #define TGSI_SEMANTIC_INVOCATIONID 27
-#define TGSI_SEMANTIC_COUNT      28 /**< number of semantic values */
+#define TGSI_SEMANTIC_PATCH      28 /**< generic per-patch semantic */
+#define TGSI_SEMANTIC_TESSCOORD  29 /**< coordinate being processed by tess */
+#define TGSI_SEMANTIC_TESSOUTER  30 /**< outer tessellation levels */
+#define TGSI_SEMANTIC_TESSINNER  31 /**< inner tessellation levels */
+#define TGSI_SEMANTIC_COUNT      32 /**< number of semantic values */
 
 struct tgsi_declaration_semantic
 {
-- 
1.8.5.5



More information about the mesa-dev mailing list