From 9cf779e7ac5509aa2d8706b882e9a6b43837cebd Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 14 May 2001 09:00:51 +0000 Subject: [PATCH] Fix for glean texgen test. --- src/mesa/drivers/common/t_dd_vb.c | 16 ++++++++-------- src/mesa/tnl/t_eval_api.c | 10 +++++++++- src/mesa/tnl/t_imm_dlist.c | 6 +++--- src/mesa/tnl/t_imm_eval.c | 6 +++++- src/mesa/tnl/t_imm_exec.c | 8 ++++---- src/mesa/tnl/t_imm_fixup.c | 38 +++++++++++++++++++++++++++++++------- 6 files changed, 60 insertions(+), 24 deletions(-) diff --git a/src/mesa/drivers/common/t_dd_vb.c b/src/mesa/drivers/common/t_dd_vb.c index 95cc0a2..b6285cd 100644 --- a/src/mesa/drivers/common/t_dd_vb.c +++ b/src/mesa/drivers/common/t_dd_vb.c @@ -1,4 +1,4 @@ -/* $Id: t_dd_vb.c,v 1.14 2001/05/09 15:34:08 keithw Exp $ */ +/* $Id: t_dd_vb.c,v 1.15 2001/05/14 09:00:52 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -313,16 +313,16 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, GLuint dst, GLuint src ) { LOCALVARS - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; + struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), + GET_COLOR(VB->ColorPtr[1], src) ); - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], src) ); - } + if (VB->SecondaryColorPtr[1]) { + COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), + GET_COLOR(VB->SecondaryColorPtr[1], src) ); + } } COPY_PV_VERTEX(ctx, dst, src); diff --git a/src/mesa/tnl/t_eval_api.c b/src/mesa/tnl/t_eval_api.c index 837fb9e..75e73fb 100644 --- a/src/mesa/tnl/t_eval_api.c +++ b/src/mesa/tnl/t_eval_api.c @@ -1,4 +1,4 @@ -/* $Id: t_eval_api.c,v 1.6 2001/05/01 13:18:03 keithw Exp $ */ +/* $Id: t_eval_api.c,v 1.7 2001/05/14 09:00:51 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -89,6 +89,14 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) * * TODO: Anaylse display lists to determine if this state is * constant. + * + * State to watch: + * - enabled maps + * - map state for each enabled map, including control points + * - grid state + * + * Could alternatively cache individual maps in arrays, rather than + * building immediates. */ { GLboolean compiling = ctx->CompileFlag; diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index 7cb947a..c9d3758 100644 --- a/src/mesa/tnl/t_imm_dlist.c +++ b/src/mesa/tnl/t_imm_dlist.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_dlist.c,v 1.18 2001/05/11 15:53:06 keithw Exp $ */ +/* $Id: t_imm_dlist.c,v 1.19 2001/05/14 09:00:51 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -150,6 +150,8 @@ execute_compiled_cassette( GLcontext *ctx, void *data ) TNLvertexcassette *node = (TNLvertexcassette *)data; struct immediate *IM = node->IM; +/* fprintf(stderr, "%s\n", __FUNCTION__); */ + if (ctx->NewState) _mesa_update_state(ctx); @@ -265,8 +267,6 @@ _tnl_EndList( GLcontext *ctx ) { struct immediate *IM = TNL_CURRENT_IM(ctx); -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - ctx->swtnl_im = 0; IM->ref_count--; diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index 324c04b..f6d33df 100644 --- a/src/mesa/tnl/t_imm_eval.c +++ b/src/mesa/tnl/t_imm_eval.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_eval.c,v 1.12 2001/05/09 11:06:30 keithw Exp $ */ +/* $Id: t_imm_eval.c,v 1.13 2001/05/14 09:00:51 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -22,6 +22,10 @@ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Keith Whitwell + * */ diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c index d011bff..7ed76b0 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.24 2001/05/11 08:11:31 keithw Exp $ */ +/* $Id: t_imm_exec.c,v 1.25 2001/05/14 09:00:51 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -82,7 +82,7 @@ static void reset_input( GLcontext *ctx, IM->ArrayEltFlags = ~ctx->Array._Enabled; IM->ArrayEltIncr = ctx->Array.Vertex.Enabled ? 1 : 0; - IM->ArrayEltFlush = !ctx->Array.LockCount; + IM->ArrayEltFlush = ctx->Array.LockCount ? FLUSH_ELT_LAZY : FLUSH_ELT_EAGER; } void _tnl_reset_exec_input( GLcontext *ctx, @@ -377,7 +377,7 @@ static void exec_vert_cassette( GLcontext *ctx, struct immediate *IM ) if (IM->FlushElt) { /* Orflag is computed twice, but only reach this code if app is * using a mixture of glArrayElement() and glVertex() while - * arrays are locked. + * arrays are locked (else would be in exec_elt_cassette now). */ ASSERT(ctx->Array.LockCount); ASSERT(IM->FlushElt == FLUSH_ELT_LAZY); @@ -440,7 +440,7 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM ) TNLcontext *tnl = TNL_CONTEXT(ctx); _tnl_compute_orflag( IM, IM->Start ); - _tnl_copy_immediate_vertices( ctx, IM ); /* ?? flags, orflag above */ + _tnl_copy_immediate_vertices( ctx, IM ); _tnl_get_exec_copy_verts( ctx, IM ); if (tnl->pipeline.build_state_changes) diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index 5300585..ea51850 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.16 2001/05/11 15:53:06 keithw Exp $ */ +/* $Id: t_imm_fixup.c,v 1.17 2001/05/14 09:00:51 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -364,6 +364,18 @@ static void copy_material( struct immediate *next, MEMCPY(next->Material[dst], prev->Material[src], 2*sizeof(GLmaterial)); } +static GLboolean is_fan_like[GL_POLYGON+1] = { + GL_FALSE, + GL_FALSE, + GL_FALSE, + GL_TRUE, /* line loop */ + GL_FALSE, + GL_FALSE, + GL_TRUE, /* tri fan */ + GL_FALSE, + GL_FALSE, + GL_TRUE /* polygon */ +}; /* Copy the untransformed data from the shared vertices of a primitive @@ -412,8 +424,21 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next ) /* prev->CopyOrFlag is hacked to include values generated by eval: */ GLuint copy = tnl->pipeline.inputs & prev->CopyOrFlag; - - next->TexSize |= tnl->ExecCopyTexSize; + GLuint flag; + + if (is_fan_like[ctx->Driver.CurrentExecPrimitive]) { + next->TexSize |= tnl->ExecCopyTexSize; + next->CopyOrFlag |= (prev->CopyOrFlag & VERT_FIXUP); + next->CopyAndFlag &= (prev->CopyOrFlag & VERT_FIXUP); + flag = (prev->CopyOrFlag & VERT_FIXUP); + } + else { + /* Don't let an early 'glColor', etc. poison the elt path. + */ + next->CopyAndFlag &= (prev->OrFlag & VERT_FIXUP); + flag = (prev->OrFlag & VERT_FIXUP); + } + /* Copy whole vertices */ @@ -464,11 +489,10 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next ) next->FogCoord[dst] = prev->FogCoord[src]; } - next->Flag[dst] = (prev->CopyOrFlag & VERT_FIXUP); + next->Flag[dst] = flag; + next->OrFlag |= prev->Flag[src]; /* for non-fanlike prims, + otherwise redundant */ } - - next->CopyOrFlag |= (prev->CopyOrFlag & VERT_FIXUP); - next->CopyAndFlag &= (prev->CopyOrFlag & VERT_FIXUP); } if (--tnl->ExecCopySource->ref_count == 0) -- 2.7.4