summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-04-23 10:53:00 -0600
committerBrian Paul <[email protected]>2013-04-23 21:09:17 -0600
commit976b529b7c977e11a487c61d92bc5037cfd32155 (patch)
tree6dc4c36e09fe236f3c04e53004a6ef6a928262bd /src/mesa/main/context.h
parent9a32203e1618486e87c7baf494134e05f0e38cf3 (diff)
mesa: use new _mesa_inside_begin_end() function
Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 1b881f3f337..05251849b57 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -190,6 +190,17 @@ _mesa_Flush( void );
/**
+ * Are we currently between glBegin and glEnd?
+ * During execution, not display list compilation.
+ */
+static inline GLboolean
+_mesa_inside_begin_end(const struct gl_context *ctx)
+{
+ return ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END;
+}
+
+
+/**
* \name Macros for flushing buffered rendering commands before state changes,
* checking if inside glBegin/glEnd, etc.
*/
@@ -242,7 +253,7 @@ do { \
*/
#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \
do { \
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
+ if (_mesa_inside_begin_end(ctx)) { \
_mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
return retval; \
} \
@@ -256,7 +267,7 @@ do { \
*/
#define ASSERT_OUTSIDE_BEGIN_END(ctx) \
do { \
- if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
+ if (_mesa_inside_begin_end(ctx)) { \
_mesa_error(ctx, GL_INVALID_OPERATION, "Inside glBegin/glEnd"); \
return; \
} \