From: Keith Whitwell Date: Thu, 5 Dec 2002 11:49:46 +0000 (+0000) Subject: Don't crash if End received without a Begin... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46b99c9016860af0cf4c4b19329fa82bddecb8ee;p=mesa.git Don't crash if End received without a Begin... --- 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 */