break;
#endif /* FEATURE_NV_vertex_program */
+ /* GL_NV_primitive_restart */
+ case GL_PRIMITIVE_RESTART_NV:
+ if (!ctx->Extensions.NV_primitive_restart) {
+ goto invalid_enum_error;
+ }
+ var = &ctx->Array.PrimitiveRestart;
+ break;
+
default:
goto invalid_enum_error;
}
break;
#endif
- /* GL 3.1 primitive restart */
+ /* GL 3.1 primitive restart. Note: this enum is different from
+ * GL_PRIMITIVE_RESTART_NV (which is client state).
+ */
case GL_PRIMITIVE_RESTART:
- if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
goto invalid_enum_error;
}
if (ctx->Array.PrimitiveRestart != state) {
return ctx->TransformFeedback.RasterDiscard;
#endif
+ /* GL_NV_primitive_restart */
+ case GL_PRIMITIVE_RESTART_NV:
+ if (!ctx->Extensions.NV_primitive_restart) {
+ goto invalid_enum_error;
+ }
+ return ctx->Array.PrimitiveRestart;
+
/* GL 3.1 primitive restart */
case GL_PRIMITIVE_RESTART:
- if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
goto invalid_enum_error;
}
return ctx->Array.PrimitiveRestart;
EXTRA_END
};
+static const int
+extra_NV_primitive_restart[] = {
+ EXT(NV_primitive_restart),
+ EXTRA_END
+};
+
static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END };
static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END };
static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
{ GL_MAX_SPOT_EXPONENT_NV, CONTEXT_FLOAT(Const.MaxSpotExponent),
extra_NV_light_max_exponent },
+ /* GL_NV_primitive_restart */
+ { GL_PRIMITIVE_RESTART_NV, CONTEXT_BOOL(Array.PrimitiveRestart),
+ extra_NV_primitive_restart },
+ { GL_PRIMITIVE_RESTART_INDEX_NV, CONTEXT_INT(Array.RestartIndex),
+ extra_NV_primitive_restart },
+
/* GL_ARB_vertex_buffer_object */
{ GL_INDEX_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT,
offsetof(struct gl_array_object, Index.BufferObj), NO_EXTRA },
{ GL_CONTEXT_FLAGS, CONTEXT_INT(Const.ContextFlags), extra_version_30 },
/* GL 3.1 */
+ /* NOTE: different enum values for GL_PRIMITIVE_RESTART_NV
+ * vs. GL_PRIMITIVE_RESTART!
+ */
{ GL_PRIMITIVE_RESTART, CONTEXT_BOOL(Array.PrimitiveRestart),
extra_version_31 },
{ GL_PRIMITIVE_RESTART_INDEX, CONTEXT_INT(Array.RestartIndex),
extra_version_31 },
+
/* GL 3.2 */
{ GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask),
extra_version_32 },
/**
- * GL 3.1 glPrimitiveRestartIndex().
+ * GL_NV_primitive_restart and GL 3.1
*/
void GLAPIENTRY
_mesa_PrimitiveRestartIndex(GLuint index)
{
GET_CURRENT_CONTEXT(ctx);
- if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glPrimitiveRestartIndex()");
+ if (!ctx->Extensions.NV_primitive_restart &&
+ ctx->VersionMajor * 10 + ctx->VersionMinor < 31) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glPrimitiveRestartIndexNV()");
return;
}