mesa: Delete the ctx->Array._RestartIndex derived state.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 29 May 2013 15:31:54 +0000 (08:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 May 2013 21:22:17 +0000 (14:22 -0700)
It's incorrect and isn't used any longer.

v2: Actually flush vertices/flag _NEW_TRANSFORM on RestartIndex change.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/attrib.c
src/mesa/main/enable.c
src/mesa/main/mtypes.h
src/mesa/main/varray.c

index c118a94da28935044e55679d48a2c444d71e7b76..249e88a4a35bd787fadaad54d5cfd85847730a74 100644 (file)
@@ -1399,7 +1399,6 @@ copy_array_attrib(struct gl_context *ctx,
    dest->PrimitiveRestartFixedIndex = src->PrimitiveRestartFixedIndex;
    dest->_PrimitiveRestart = src->_PrimitiveRestart;
    dest->RestartIndex = src->RestartIndex;
-   dest->_RestartIndex = src->_RestartIndex;
    /* skip NewState */
    /* skip RebindArrays */
 
index 016e432d9605900ec9648ee7b0c4061ae2edbc3f..fdde24e36fa8544b2ec803592ed6c863d963a718 100644 (file)
@@ -53,11 +53,6 @@ update_derived_primitive_restart_state(struct gl_context *ctx)
 {
    /* Update derived primitive restart state.
     */
-   if (ctx->Array.PrimitiveRestart)
-      ctx->Array._RestartIndex = ctx->Array.RestartIndex;
-   else
-      ctx->Array._RestartIndex = ~0;
-
    ctx->Array._PrimitiveRestart = ctx->Array.PrimitiveRestart
       || ctx->Array.PrimitiveRestartFixedIndex;
 }
index e0e188606c5a604354ab4cc90e63444e1e182e1d..882ebe146193323923be74e540eb1ded0b5e84ee 100644 (file)
@@ -1534,15 +1534,13 @@ struct gl_array_attrib
     * \name Primitive restart controls
     *
     * Primitive restart is enabled if either \c PrimitiveRestart or
-    * \c PrimitiveRestartFixedIndex is set.  If \c PrimitiveRestart is set,
-    * then \c RestartIndex is used as the cut vertex.  Otherwise ~0 is used.
+    * \c PrimitiveRestartFixedIndex is set.
     */
    /*@{*/
    GLboolean PrimitiveRestart;
    GLboolean PrimitiveRestartFixedIndex;
    GLboolean _PrimitiveRestart;
    GLuint RestartIndex;
-   GLuint _RestartIndex;
    /*@}*/
 
    /* GL_ARB_vertex_buffer_object */
index dff007004306cc6b875465f7f0147e0b586835b9..db0945e309516beee704703e560a622a25566646 100644 (file)
@@ -1109,10 +1109,9 @@ _mesa_PrimitiveRestartIndex(GLuint index)
       return;
    }
 
-   ctx->Array.RestartIndex = index;
-   if (ctx->Array.PrimitiveRestart && ctx->Array._RestartIndex != index) {
+   if (ctx->Array.RestartIndex != index) {
       FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
-      ctx->Array._RestartIndex = index;
+      ctx->Array.RestartIndex = index;
    }
 }