summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-05-01 19:15:32 -0600
committerBrian Paul <[email protected]>2013-05-02 09:03:15 -0600
commit94c7caf406debc0d35153267f491e30a203f9a72 (patch)
treef6eceb3e8ebb4d0ef96cf1968f7ae050be0c97ef /src/mesa
parentc1a5c5c13d838309cf88664edf159e6086408f28 (diff)
mesa: add missing error check in _mesa_EndList()
If we're in GL_COMPILE_AND_EXECUTE mode and inside glBegin, calling glEndList() should generate an error. Fixes a failure in piglit's gl-1.0-beginend-coverage test. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/dlist.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 3dd676bc23b..882163e51ad 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -8652,6 +8652,12 @@ _mesa_EndList(void)
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glEndList\n");
+ if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)
+ && ctx->Driver.CurrentSavePrimitive != PRIM_UNKNOWN) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEndList() called inside glBegin/End");
+ }
+
/* Check that a list is under construction */
if (!ctx->ListState.CurrentList) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");