From dbd0dad580a6bf501441df95fccf2db718fd5d45 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 16 May 2001 09:28:32 +0000 Subject: [PATCH] fix for Jouk's glplanet bug --- src/mesa/tnl/t_context.h | 3 ++- src/mesa/tnl/t_imm_exec.c | 3 ++- src/mesa/tnl/t_imm_fixup.c | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 9864c8e..e419e0c 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -1,4 +1,4 @@ -/* $Id: t_context.h,v 1.24 2001/05/11 08:11:31 keithw Exp $ */ +/* $Id: t_context.h,v 1.25 2001/05/16 09:28:32 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -271,6 +271,7 @@ typedef struct vertex_buffer GLuint importable_data; + void *import_source; void (*import_data)( GLcontext *ctx, GLuint flags, GLuint vecflags ); /* Callback to the provider of the untransformed input for the * render stage (or other stages) to call if they need to write into diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c index 7ed76b0..37dd159 100644 --- a/src/mesa/tnl/t_imm_exec.c +++ b/src/mesa/tnl/t_imm_exec.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_exec.c,v 1.25 2001/05/14 09:00:51 keithw Exp $ */ +/* $Id: t_imm_exec.c,v 1.26 2001/05/16 09:28:32 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -314,6 +314,7 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM ) tmp->Color.Ptr = ctx->Current.Color; tmp->Color.StrideB = 0; tmp->Color.Flags = CA_CLIENT_DATA; /* hack */ + VB->import_source = IM; VB->importable_data |= VERT_RGBA; VB->import_data = _tnl_upgrade_current_data; } diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index 0f555d4..126aba1 100644 --- a/src/mesa/tnl/t_imm_fixup.c +++ b/src/mesa/tnl/t_imm_fixup.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_fixup.c,v 1.18 2001/05/14 16:34:24 keithw Exp $ */ +/* $Id: t_imm_fixup.c,v 1.19 2001/05/16 09:28:32 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -824,8 +824,8 @@ void _tnl_upgrade_current_data( GLcontext *ctx, GLuint flags ) { TNLcontext *tnl = TNL_CONTEXT(ctx); - struct immediate *IM = TNL_CURRENT_IM(ctx); /* hmmm */ struct vertex_buffer *VB = &tnl->vb; + struct immediate *IM = (struct immediate *)VB->import_source; ASSERT(IM); @@ -840,6 +840,9 @@ void _tnl_upgrade_current_data( GLcontext *ctx, tmp->Flags = 0; COPY_4FV( IM->Color[start], ctx->Current.Color); + + ASSERT(IM->Flag[IM->LastData+1] & VERT_END_VB); + fixup_first_4f( IM->Color, IM->Flag, VERT_END_VB, start, IM->Color[start] ); -- 2.7.4