On 05/28/2013 04:06 PM, Eric Anholt wrote:
Kenneth Graunke <kenn...@whitecape.org> writes:
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index dff0070..5f10f0c 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1110,9 +1110,8 @@ _mesa_PrimitiveRestartIndex(GLuint index)
     }

     ctx->Array.RestartIndex = index;
-   if (ctx->Array.PrimitiveRestart && ctx->Array._RestartIndex != index) {
+   if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex != index) {
        FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
-      ctx->Array._RestartIndex = index;
     }
  }

I don't think your conditional will ever trigger now.  I think you want
to just move the "ctx->Array.RestartIndex = index" inside the block, so
that previously-queued drawing is successfully flushed with the old
restart index, not the new one.

Other than that, this series is:

Reviewed-by: Eric Anholt <e...@anholt.net>

Oops...you're right, of course.  What I meant was:

   if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex != index)
      FLUSH_VERTICES(ctx, _NEW_TRANSFORM);

   ctx->Array.RestartIndex = index;

This avoids the flush/state flagging when GL-style primitive restart is disabled, since in that case the restart index is irrelevant. Notably, changing either ctx->Array.PrimitiveRestart or ctx->Array.PrimitiveRestartFixedIndex flushes vertices with _NEW_TRANSFORM, so it ought to work.

Or I could just go back to what we had before Ian's patch:

if (ctx->Array.RestartIndex != index) {
   FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
   ctx->Array.RestartIndex = index;
}

which is obvious and simple.  Which would you prefer?

--Ken
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to