summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-10-21 19:03:38 -0600
committerBrian Paul <[email protected]>2010-10-21 19:03:38 -0600
commit7f26ad80ba74b9c78a3735caee202e1868f6ff58 (patch)
tree8a6150c94813626510dd3f2282db421de1be9663 /src/mesa/main/enable.c
parenta80afbd99e879d36fdb4b099fd49c1f75edc8886 (diff)
mesa: set/get primitive restart state
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 5a5b199df32..af16c010b94 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -124,6 +124,14 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
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;
}
@@ -945,9 +953,11 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
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) {
@@ -1454,9 +1464,16 @@ _mesa_IsEnabled( GLenum cap )
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;