summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2002-12-05 11:49:46 +0000
committerKeith Whitwell <[email protected]>2002-12-05 11:49:46 +0000
commit46b99c9016860af0cf4c4b19329fa82bddecb8ee (patch)
treeadd057987e4aae84b55efa6d678f646e42bc5cf4
parent6cb5b3475d0d4a40479702e93b3c6a7a4129bb41 (diff)
Don't crash if End received without a Begin...
-rw-r--r--src/mesa/tnl/t_imm_api.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c
index 2c91a810de9..0cd42d0e48c 100644
--- a/src/mesa/tnl/t_imm_api.c
+++ b/src/mesa/tnl/t_imm_api.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_api.c,v 1.37 2002/11/25 20:27:47 brianp Exp $ */
+/* $Id: t_imm_api.c,v 1.38 2002/12/05 11:49:46 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -219,8 +219,8 @@ _tnl_Begin( GLenum mode )
return;
}
- assert( IM->SavedBeginState == 0 );
- assert( IM->BeginState == 0 );
+ assert( (IM->SavedBeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) == 0 );
+ assert( (IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) == 0 );
/* Not quite right. Need to use the fallback '_aa_ArrayElement'
* when not known to be inside begin/end and arrays are
@@ -346,7 +346,10 @@ _tnl_end( GLcontext *ctx )
GLuint state = IM->BeginState;
GLuint inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
- assert( ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES );
+ /* Not the case if vertices emitted without calling glBegin first:
+ */
+/* assert( ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES ); */
+
state |= inflags << 2; /* errors */