-/* $Id: t_imm_api.c,v 1.35 2002/10/29 20:29:01 brianp Exp $ */
+/* $Id: t_imm_api.c,v 1.39 2003/01/14 04:55:47 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
}
#endif
+ if (IM->Count > IMM_MAXDATA-8) {
+ _tnl_flush_immediate( ctx, IM );
+ IM = TNL_CURRENT_IM(ctx);
+ }
+
/* Check for and flush buffered vertices from internal operations.
*/
if (IM->SavedBeginState) {
if (ctx->NewState)
_mesa_update_state(ctx);
+ {
+ struct immediate *IM = TNL_CURRENT_IM(ctx);
+ if (IM->Count > IMM_MAXDATA-8) {
+ _tnl_flush_immediate( ctx, IM );
+ IM = TNL_CURRENT_IM(ctx);
+ }
+ }
+
+
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
GLuint count = IM->Count;
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
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 */
* don't crash. We no-op on invalid targets.
*/
-#define MAX_TARGET (GL_TEXTURE0_ARB + MAX_TEXTURE_UNITS)
+#define MAX_TARGET (GL_TEXTURE0_ARB + MAX_TEXTURE_COORD_UNITS)
#define MULTI_TEXCOORD1(target, s) \
{ \