summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/varray.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-08-10 22:28:27 -0700
committerIan Romanick <ian.d.romanick@intel.com>2013-01-11 10:57:25 -0800
commit42ed81a7c3eec215a543c47239cc30536f284ada (patch)
tree0f71500ae3bf3a99f98f2481670a88124feb399e /src/mesa/main/varray.c
parent00d8ad81ffeda1d2a10b1ee65f4a144467d0afd1 (diff)
downloadexternal_mesa3d-42ed81a7c3eec215a543c47239cc30536f284ada.zip
external_mesa3d-42ed81a7c3eec215a543c47239cc30536f284ada.tar.gz
external_mesa3d-42ed81a7c3eec215a543c47239cc30536f284ada.tar.bz2
mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEX
This requires some derived state. The cut vertex used is either the value specified by glPrimitiveRestartIndex or it's hard-coded to ~0. The derived state gl_array_attrib::_RestartIndex captures this value. In addition, the derived state gl_array_attrib::_PrimitiveRestart is set whenever either gl_array_attrib::PrimitiveRestart or gl_array_attrib::PrimitiveRestartFixedIndex is set. v2: Use _mesa_is_gles3. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r--src/mesa/main/varray.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 5e4d6c3..e453b3b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1113,9 +1113,10 @@ _mesa_PrimitiveRestartIndex(GLuint index)
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Array.RestartIndex != index) {
+ ctx->Array.RestartIndex = index;
+ if (ctx->Array.PrimitiveRestart && ctx->Array._RestartIndex != index) {
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
- ctx->Array.RestartIndex = index;
+ ctx->Array._RestartIndex = index;
}
}