mesa: Add SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 19 Jun 2014 01:08:20 +0000 (18:08 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 10 Sep 2014 18:04:48 +0000 (11:04 -0700)
There exists hardware, such as i965, that does not implement the OpenGL
semantic for gl_VertexID.  Instead, that hardware does not include the
value of basevertex in the gl_VertexID value.
SYSTEM_VALUE_VERTEX_ID_ZERO_BASE is the system value that represents
this semantic.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 58a55d454045ecee9453e50d7235b20710c43b3a..32e308a6172008c62aae5cce095a01b112bacb35 100644 (file)
@@ -2083,6 +2083,8 @@ typedef enum
     *
     * gl_VertexID gets basevertex added in.  This differs from DirectX where
     * SV_VertexID does \b not get basevertex added in.
+    *
+    * \sa SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
     */
    SYSTEM_VALUE_VERTEX_ID,
 
@@ -2114,6 +2116,16 @@ typedef enum
     * Note that baseinstance is \b not included in the value of instance.
     */
    SYSTEM_VALUE_INSTANCE_ID,
+
+   /**
+    * DirectX-style vertex ID.
+    *
+    * Unlike \c SYSTEM_VALUE_VERTEX_ID, this system value does \b not include
+    * the value of basevertex.
+    *
+    * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_BASE_VERTEX
+    */
+   SYSTEM_VALUE_VERTEX_ID_ZERO_BASE,
    /*@}*/
 
    /**
index 62e4101d1642567ad825d8ffbc3528ed0a36dc96..18354605f8f58eba109d408414d8b7872d38fcf8 100644 (file)
@@ -4167,6 +4167,7 @@ const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
     */
    TGSI_SEMANTIC_VERTEXID,
    TGSI_SEMANTIC_INSTANCEID,
+   0,
 
    /* Geometry shader
     */