-/* $Id: t_context.h,v 1.30 2001/07/12 22:09:22 keithw Exp $ */
+/* $Id: t_context.h,v 1.31 2001/08/01 05:10:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint CopyOrFlag;
GLuint CopyAndFlag;
GLuint CopyTexSize;
+ GLuint Evaluated;
/* allocate storage for these on demand:
-/* $Id: t_imm_debug.c,v 1.3 2001/04/28 08:39:18 keithw Exp $ */
+/* $Id: t_imm_debug.c,v 1.4 2001/08/01 05:10:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint i;
GLuint *flags = IM->Flag;
GLuint andflag = IM->CopyAndFlag;
- GLuint orflag = IM->CopyOrFlag;
+ GLuint orflag = (IM->CopyOrFlag|IM->Evaluated);
GLuint state = IM->BeginState;
GLuint req = ~0;
-/* $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
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]);
+ }
}
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 );
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)
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) );
}
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) );
}
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 );
}
&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) );
}
/* 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);
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. */
}
}
-/* $Id: t_imm_exec.c,v 1.27 2001/06/28 17:34:14 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.28 2001/08/01 05:10:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
IM->Flag[IM->LastData+1] |= VERT_END_VB;
IM->CopyAndFlag = IM->AndFlag = andflag;
IM->CopyOrFlag = IM->OrFlag = orflag;
+ IM->Evaluated = 0;
}
-/* $Id: t_imm_fixup.c,v 1.23 2001/07/17 21:44:37 keithw Exp $ */
+/* $Id: t_imm_fixup.c,v 1.24 2001/08/01 05:10:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
{
GLuint i = start;
+
for (;;) {
if ((flag[++i] & match) == 0) {
+/* fprintf(stderr, "_tnl_fixup_3f copy to %p values %f %f %f\n", */
+/* data[i], */
+/* data[i-1][0], */
+/* data[i-1][1], */
+/* data[i-1][2]); */
COPY_3V(data[i], data[i-1]);
if (flag[i] & VERT_END_VB) break;
}
GLuint i = start-1;
match |= VERT_END_VB;
+/* fprintf(stderr, "fixup_first_3f\n"); */
+
while ((flag[++i]&match) == 0)
COPY_3FV(data[i], dflt);
}
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint start = IM->CopyStart;
GLuint andflag = IM->CopyAndFlag;
- GLuint orflag = IM->CopyOrFlag;
+ GLuint orflag = IM->CopyOrFlag | IM->Evaluated;
GLuint fixup;
IM->CopyTexSize = IM->TexSize;
next->CopyAndFlag &= VERT_ELT;
}
else {
- /* prev->CopyOrFlag is hacked to include values generated by eval:
- */
- GLuint copy = tnl->pipeline.inputs & prev->CopyOrFlag;
+ GLuint copy = tnl->pipeline.inputs & (prev->CopyOrFlag|prev->Evaluated);
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);
+ flag = ((prev->CopyOrFlag|prev->Evaluated) & VERT_FIXUP);
+ next->CopyOrFlag |= flag;
}
else {
/* Don't let an early 'glColor', etc. poison the elt path.
*/
- next->CopyAndFlag &= (prev->OrFlag & VERT_FIXUP);
- flag = (prev->OrFlag & VERT_FIXUP);
+ flag = ((prev->OrFlag|prev->Evaluated) & VERT_FIXUP);
}
+
+ next->TexSize |= tnl->ExecCopyTexSize;
+ next->CopyAndFlag &= flag;
/* Copy whole vertices
*/
COPY_4FV( next->Obj[dst], inputs->Obj.data[isrc] );
- if (copy & VERT_NORM)
+ if (copy & VERT_NORM) {
+/* fprintf(stderr, "copy vert norm %d to %d (%p): %f %f %f\n", */
+/* isrc, dst, */
+/* next->Normal[dst], */
+/* inputs->Normal.data[isrc][0], */
+/* inputs->Normal.data[isrc][1], */
+/* inputs->Normal.data[isrc][2]); */
COPY_3FV( next->Normal[dst], inputs->Normal.data[isrc] );
+ }
if (copy & VERT_RGBA)
COPY_4FV( next->Color[dst],
}
next->Flag[dst] = flag;
- next->OrFlag |= prev->Flag[src]; /* for non-fanlike prims,
- otherwise redundant */
+ next->CopyOrFlag |= prev->Flag[src];
}
}
GLuint fixup;
GLuint start = IM->Start;
+ IM->Evaluated = 0;
IM->CopyOrFlag = IM->OrFlag;
IM->CopyAndFlag = IM->AndFlag;
IM->CopyTexSize = IM->TexSize | tnl->ExecCopyTexSize;
-/* $Id: t_vb_lighttmp.h,v 1.14 2001/07/28 19:28:49 keithw Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.15 2001/08/01 05:10:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
-/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
+/* fprintf(stderr, "%s\n", __FUNCTION__ ); */
spec[0] = Fspec;
spec[1] = Bspec;
do {
GLfloat n_dot_VP = DOT3(normal, light->_VP_inf_norm);
-
if (n_dot_VP < 0.0F) {
if (IDX & LIGHT_TWOSIDE) {
GLfloat n_dot_h = -DOT3(normal, light->_h_inf_norm);
ctx->Light.Material[1].Diffuse[3]);
}
+
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
if (IDX & LIGHT_TWOSIDE)
COPY_3V(sum[1], ctx->Light._BaseColor[1]);