diff options
author | Keith Whitwell <[email protected]> | 2001-08-01 05:10:42 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-08-01 05:10:42 +0000 |
commit | c618005dcff0d4011a77cfebd109880eb784d581 (patch) | |
tree | af1c96ae97c11a4a0474b48374aaba059bd744ba /src/mesa/tnl/t_imm_eval.c | |
parent | 3670e206a76d3c197bdfab8293e48623a87c7827 (diff) |
Fix copying problem (light spots) on evaluated surfaces.
Diffstat (limited to 'src/mesa/tnl/t_imm_eval.c')
-rw-r--r-- | src/mesa/tnl/t_imm_eval.c | 65 |
1 files changed, 16 insertions, 49 deletions
diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index f6d33dfa1a4..1ae006666fd 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.13 2001/05/14 09:00:51 keithw Exp $ */ +/* $Id: t_imm_eval.c,v 1.14 2001/08/01 05:10:42 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -343,7 +343,14 @@ static void copy_4f_stride( GLfloat to[][4], GLfloat *from, static void copy_3f( GLfloat to[][3], GLfloat from[][3], GLuint count ) { - MEMCPY( to, from, (count) * sizeof(to[0])); + int i; +/* MEMCPY( to, from, (count) * sizeof(to[0])); */ + for (i = 0 ; i < count ; i++) { +/* fprintf(stderr, "copy norm %d from %p: %f %f %f\n", i, */ +/* from[i], */ +/* from[i][0], from[i][1], from[i][2]); */ + COPY_3FV(to[i], from[i]); + } } @@ -442,8 +449,8 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) else copycount = IM->Count - IM->CopyStart; /* copy all vertices */ -/* fprintf(stderr, "%s copystart %d start %d count %d copycount %d\n", */ -/* __FUNCTION__, IM->CopyStart, IM->Start, IM->Count, copycount); */ +/* fprintf(stderr, "%s copystart %d start %d count %d copycount %d\n", */ +/* __FUNCTION__, IM->CopyStart, IM->Start, IM->Count, copycount); */ if (!store) store = tnl->eval.im = _tnl_alloc_immediate( ctx ); @@ -509,16 +516,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) eval2_1ui( &tmp->Index, coord, flags, &ctx->EvalMap.Map2Index ); generated |= VERT_EVAL_C2|VERT_EVAL_P2; } - - /* Propogate values to generate correct vertices when vertex - * maps are disabled. - */ - if (purge_flags & generated) - _tnl_fixup_1ui( tmp->Index.data, flags, 0, - VERT_INDEX| - VERT_OBJ| - generated| - (VERT_EVAL_ANY&~purge_flags) ); } if (req & VERT_RGBA) @@ -545,17 +542,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) eval2_4f_ca( &tmp->Color, coord, flags, 4, &ctx->EvalMap.Map2Color4 ); generated |= VERT_EVAL_C2|VERT_EVAL_P2; } - - /* Propogate values to generate correct vertices when vertex - * maps are disabled. - */ - if (purge_flags & generated) - _tnl_fixup_4f( store->Color + IM->CopyStart, - flags, 0, - VERT_RGBA| - VERT_OBJ| - generated| - (VERT_EVAL_ANY&~purge_flags) ); } @@ -617,16 +603,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) generated |= VERT_EVAL_C2|VERT_EVAL_P2; } } - - /* Propogate values to generate correct vertices when vertex - * maps are disabled. - */ - if (purge_flags & generated) - _tnl_fixup_4f( tmp->TexCoord[0].data, flags, 0, - VERT_TEX0| - VERT_OBJ| - generated| - (VERT_EVAL_ANY&~purge_flags) ); } @@ -635,7 +611,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) GLuint generated = 0; if (copycount) { -/* fprintf(stderr, "%s: Copy normals\n", __FUNCTION__); */ +/* fprintf(stderr, "%s: Copy normals\n", __FUNCTION__); */ copy_3f( store->Normal + IM->CopyStart, tmp->Normal.data, copycount ); } @@ -654,16 +630,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) &ctx->EvalMap.Map2Normal ); generated |= VERT_EVAL_C2|VERT_EVAL_P2; } - - /* Propogate values to generate correct vertices when vertex - * maps are disabled. - */ - if (purge_flags & generated) - _tnl_fixup_3f( tmp->Normal.data, flags, 0, - VERT_NORM| - VERT_OBJ| - generated| - (VERT_EVAL_ANY&~purge_flags) ); } @@ -723,8 +689,9 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) /* Calculate new IM->Elts, IM->Primitive, IM->PrimitiveLength for - * the case where vertex maps are not enabled for some received eval - * coordinates. + * the case where vertex maps are not enabled for some received + * eval coordinates. In this case those slots in the immediate + * must be ignored. */ if (purge_flags) { GLuint vertex = VERT_OBJ|(VERT_EVAL_ANY & ~purge_flags); @@ -763,6 +730,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) tnl->vb.Flag = store->Flag; for (i = 0 ; i < count ; i++) store->Flag[i] |= req; - IM->CopyOrFlag |= req; /* hack for copying. */ + IM->Evaluated = req; /* hack for copying. */ } } |