summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-20 21:02:09 -0600
committerBrian Paul <[email protected]>2010-04-20 21:02:09 -0600
commita40e6f220ac7e41126b9815db27d362bda719bf6 (patch)
treee33791e75fff35af2d90d258d892aef14f9921db /src/mesa/main/enable.c
parentbd1d35fb5d3c889b11de5a1d493f711fc091fbed (diff)
mesa: API and state for GL 3.1 primitive restart
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index d24564c3537..72787226dc4 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -990,6 +990,17 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
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;
}
@@ -1509,6 +1520,13 @@ _mesa_IsEnabled( GLenum cap )
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;
}