summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-11-25 13:55:31 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-11-25 13:55:31 +0000
commite44bf40402f27171305df8506e6d53c7ba9c596b (patch)
treeaba2e8a165776a013a20ace3989c3da3617a24a1 /src/mesa/tnl
parent3ac8105e9cbed4c531c38636f83065b2ef3ab002 (diff)
Flush IM if very small number of verts left -- prevent copy errors
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_imm_api.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c
index 3bdcd38d72..1bef32b3ff 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.35 2002/10/29 20:29:01 brianp Exp $ */
+/* $Id: t_imm_api.c,v 1.36 2002/11/25 13:55:31 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -127,6 +127,11 @@ _tnl_save_Begin( GLenum mode )
}
#endif
+ if (IM->Count > IMM_MAXDATA-8) {
+ _tnl_flush_immediate( IM );
+ IM = TNL_CURRENT_IM(ctx);
+ }
+
/* Check for and flush buffered vertices from internal operations.
*/
if (IM->SavedBeginState) {
@@ -196,6 +201,15 @@ _tnl_Begin( GLenum mode )
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
+ if (IM->Count > IMM_MAXDATA-8) {
+ _tnl_flush_immediate( IM );
+ IM = TNL_CURRENT_IM(ctx);
+ }
+ }
+
+
+ {
+ struct immediate *IM = TNL_CURRENT_IM(ctx);
GLuint count = IM->Count;
GLuint last = IM->LastPrimitive;