break;
#endif
+ /* GL 3.1 primitive restart */
+ case GL_PRIMITIVE_RESTART:
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ goto invalid_enum_error;
+ }
+ if (ctx->Array.PrimitiveRestart != state) {
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+ ctx->Array.PrimitiveRestart = state;
+ }
+ break;
+
default:
goto invalid_enum_error;
}
return ctx->TransformFeedback.RasterDiscard;
#endif
+ /* GL 3.1 primitive restart */
+ case GL_PRIMITIVE_RESTART:
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ goto invalid_enum_error;
+ }
+ return ctx->Array.PrimitiveRestart;
+
default:
goto invalid_enum_error;
}
case GL_CONTEXT_FLAGS:
params[0] = INT_TO_BOOLEAN(ctx->Const.ContextFlags);
break;
+ case GL_PRIMITIVE_RESTART:
+ params[0] = ctx->Array.PrimitiveRestart;
+ break;
+ case GL_PRIMITIVE_RESTART_INDEX:
+ params[0] = INT_TO_BOOLEAN(ctx->Array.RestartIndex);
+ break;
case GL_CONTEXT_PROFILE_MASK:
params[0] = INT_TO_BOOLEAN(ctx->Const.ProfileMask);
break;
case GL_CONTEXT_FLAGS:
params[0] = (GLfloat)(ctx->Const.ContextFlags);
break;
+ case GL_PRIMITIVE_RESTART:
+ params[0] = BOOLEAN_TO_FLOAT(ctx->Array.PrimitiveRestart);
+ break;
+ case GL_PRIMITIVE_RESTART_INDEX:
+ params[0] = (GLfloat)(ctx->Array.RestartIndex);
+ break;
case GL_CONTEXT_PROFILE_MASK:
params[0] = (GLfloat)(ctx->Const.ProfileMask);
break;
case GL_CONTEXT_FLAGS:
params[0] = ctx->Const.ContextFlags;
break;
+ case GL_PRIMITIVE_RESTART:
+ params[0] = BOOLEAN_TO_INT(ctx->Array.PrimitiveRestart);
+ break;
+ case GL_PRIMITIVE_RESTART_INDEX:
+ params[0] = ctx->Array.RestartIndex;
+ break;
case GL_CONTEXT_PROFILE_MASK:
params[0] = ctx->Const.ProfileMask;
break;
case GL_CONTEXT_FLAGS:
params[0] = (GLint64)(ctx->Const.ContextFlags);
break;
+ case GL_PRIMITIVE_RESTART:
+ params[0] = BOOLEAN_TO_INT64(ctx->Array.PrimitiveRestart);
+ break;
+ case GL_PRIMITIVE_RESTART_INDEX:
+ params[0] = (GLint64)(ctx->Array.RestartIndex);
+ break;
case GL_CONTEXT_PROFILE_MASK:
params[0] = (GLint64)(ctx->Const.ProfileMask);
break;
( "GL_MINOR_VERSION", GLint, ["ctx->VersionMinor"], "", NoState, NoExt ),
( "GL_CONTEXT_FLAGS", GLint, ["ctx->Const.ContextFlags"], "", NoState, NoExt ),
+ # GL 3.1
+ ( "GL_PRIMITIVE_RESTART", GLboolean,
+ ["ctx->Array.PrimitiveRestart"], "", NoState, NoExt ),
+ ( "GL_PRIMITIVE_RESTART_INDEX", GLint,
+ ["ctx->Array.RestartIndex"], "", NoState, NoExt ),
+
# GL 3.2
( "GL_CONTEXT_PROFILE_MASK", GLint, ["ctx->Const.ProfileMask"], "",
NoState, NoExt )
GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */
GLuint LockCount; /**< GL_EXT_compiled_vertex_array */
+ /** GL 3.1 (slightly different from GL_NV_primitive_restart) */
+ GLboolean PrimitiveRestart;
+ GLuint RestartIndex;
+
GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */
#if FEATURE_ARB_vertex_buffer_object
}
+/**
+ * GL 3.1 glPrimitiveRestartIndex().
+ */
+void GLAPIENTRY
+_mesa_PrimitiveRestartIndex(GLuint index)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glPrimitiveRestartIndex()");
+ return;
+ }
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+
+ ctx->Array.RestartIndex = index;
+}
+
+
/**
* Copy one client vertex array to another.
*/
const GLvoid *indices,
GLint basevertex);
+extern void GLAPIENTRY
+_mesa_PrimitiveRestartIndex(GLuint index);
+
extern void
_mesa_copy_client_array(GLcontext *ctx,