-/* $Id: t_array_import.c,v 1.12 2001/04/17 17:01:33 brianp Exp $ */
+/* $Id: t_array_import.c,v 1.13 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLboolean is_writeable = 0;
struct vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs;
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
tmp = _ac_import_color(ctx,
GL_UNSIGNED_BYTE,
stride ? 4*sizeof(GLubyte) : 0,
struct vertex_arrays *tmp = &tnl->array_inputs;
/* fprintf(stderr, "_tnl_vb_bind_arrays %d..%d // %d..%d\n", */
-/* start, count, ctx->Array.LockFirst, ctx->Array.LockCount); */
+/* start, count, ctx->Array.LockFirst, ctx->Array.LockCount); */
if (ctx->Array.LockCount) {
ASSERT(start == (GLint) ctx->Array.LockFirst);
-/* $Id: t_context.h,v 1.19 2001/04/09 14:47:34 keithw Exp $ */
+/* $Id: t_context.h,v 1.20 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint EvalMap1Flags;
GLuint EvalMap2Flags;
GLuint EvalNewState;
-
- GLfloat Coord[IMM_SIZE][4];
- GLfloat Obj[IMM_SIZE][4];
- GLfloat TexCoord[IMM_SIZE][4];
- GLfloat Normal[IMM_SIZE][3];
- GLchan Color[IMM_SIZE][4];
- GLuint Index[IMM_SIZE];
- GLuint Flag[IMM_SIZE];
- GLuint Elts[IMM_SIZE];
+ struct immediate *im; /* used for temporary data */
};
-/* $Id: t_imm_alloc.c,v 1.5 2001/03/12 00:48:43 gareth Exp $ */
+/* $Id: t_imm_alloc.c,v 1.6 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (!IM)
return 0;
+/* memset(IM, 0, sizeof(*IM)); */
+
IM->id = id++;
IM->ref_count = 0;
IM->backref = ctx;
-/* $Id: t_imm_dlist.c,v 1.12 2001/04/09 14:47:34 keithw Exp $ */
+/* $Id: t_imm_dlist.c,v 1.13 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
TNLvertexcassette *node;
GLuint new_beginstate;
-
_tnl_compute_orflag( IM );
IM->CopyStart = IM->Start;
IM->PrimitiveLength[IM->LastPrimitive] = IM->Count - IM->LastPrimitive;
ASSERT(IM->Primitive[IM->LastPrimitive] & PRIM_LAST);
+
+/* _tnl_print_cassette( IM ); */
+
node = (TNLvertexcassette *)
_mesa_alloc_instruction(ctx,
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct immediate *IM = TNL_CURRENT_IM(ctx);
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
ctx->swtnl_im = 0;
IM->ref_count--;
if (IM == tnl->ExecCopySource) {
-/* $Id: t_imm_elt.c,v 1.6 2001/03/12 00:48:43 gareth Exp $ */
+/* $Id: t_imm_elt.c,v 1.7 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint start, GLuint n
#define SRC_START 0
#define DST_START start
-#undef CHECK
#define CHECK if ((flags[i]&match) == VERT_ELT)
#define NEXT_F (void)1
#define NEXT_F2 f = first + elts[i] * stride;
-/* $Id: t_imm_eval.c,v 1.6 2001/03/12 00:48:43 gareth Exp $ */
+/* $Id: t_imm_eval.c,v 1.7 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "t_imm_eval.h"
#include "t_imm_exec.h"
#include "t_imm_fixup.h"
+#include "t_imm_alloc.h"
static void eval_points1( GLfloat outcoord[][4],
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_arrays *tmp = &tnl->imm_inputs;
- struct tnl_eval_store *store = &tnl->eval;
+ struct immediate *store = tnl->eval.im;
GLuint *flags = tnl->vb.Flag;
GLuint count = tnl->vb.Count;
GLuint any_eval1 = orflag & (VERT_EVAL_C1|VERT_EVAL_P1);
GLuint req = 0;
GLuint purge_flags = 0;
+/* if (input->writable) */
+/* store = input; */
+
+ if (!store)
+ store = tnl->eval.im = _tnl_alloc_immediate( ctx );
+
if (tnl->eval.EvalNewState & _NEW_EVAL)
update_eval( ctx );
req |= tnl->pipeline.inputs & tnl->eval.EvalMap2Flags;
- /* Translate points into coords. Use store->Coord to hold the
+ /* Translate points into coords. Use store->Obj to hold the
* new data.
*/
if (any_eval1 && (orflag & VERT_EVAL_P1))
{
- eval_points1( store->Coord, coord, flags,
+ eval_points1( store->Obj, coord, flags,
ctx->Eval.MapGrid1du,
ctx->Eval.MapGrid1u1);
- coord = store->Coord;
+ coord = store->Obj;
}
if (any_eval2 && (orflag & VERT_EVAL_P2))
{
- eval_points2( store->Coord, coord, flags,
+ eval_points2( store->Obj, coord, flags,
ctx->Eval.MapGrid2du,
ctx->Eval.MapGrid2u1,
ctx->Eval.MapGrid2dv,
ctx->Eval.MapGrid2v1 );
- coord = store->Coord;
+ coord = store->Obj;
}
*/
if (req & VERT_INDEX)
{
+ GLuint generated = 0;
+
if (!all_eval)
copy_1ui( store->Index, tmp->Index.data, count );
tmp->Index.data = store->Index;
tmp->Index.start = store->Index;
- if (ctx->Eval.Map1Index && any_eval1)
+ if (ctx->Eval.Map1Index && any_eval1) {
eval1_1ui( &tmp->Index, coord, flags, &ctx->EvalMap.Map1Index );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ }
- if (ctx->Eval.Map2Index && any_eval2)
+ if (ctx->Eval.Map2Index && any_eval2) {
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( store->Index, flags, 0,
+ VERT_INDEX|
+ VERT_OBJ|
+ generated|
+ (VERT_EVAL_ANY&~purge_flags) );
}
if (req & VERT_RGBA)
{
+ GLuint generated = 0;
+
if (!all_eval)
copy_4chan( store->Color, tmp->Color.data, count );
tmp->Color.data = store->Color;
tmp->Color.start = (GLchan *) store->Color;
- if (ctx->Eval.Map1Color4 && any_eval1)
+ if (ctx->Eval.Map1Color4 && any_eval1) {
eval1_color( &tmp->Color, coord, flags, &ctx->EvalMap.Map1Color4 );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ }
- if (ctx->Eval.Map2Color4 && any_eval2)
+ if (ctx->Eval.Map2Color4 && any_eval2) {
eval2_color( &tmp->Color, coord, flags, &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_4chan( store->Color, flags, 0,
+ VERT_RGBA|
+ VERT_OBJ|
+ generated|
+ (VERT_EVAL_ANY&~purge_flags) );
}
if (req & VERT_TEX(0))
{
+ GLuint generated = 0;
+
if (!all_eval)
- copy_4f( store->TexCoord, tmp->TexCoord[0].data, count );
+ copy_4f( store->TexCoord[0], tmp->TexCoord[0].data, count );
else
tmp->TexCoord[0].size = 0;
- tmp->TexCoord[0].data = store->TexCoord;
- tmp->TexCoord[0].start = (GLfloat *)store->TexCoord;
+ tmp->TexCoord[0].data = store->TexCoord[0];
+ tmp->TexCoord[0].start = (GLfloat *)store->TexCoord[0];
if (any_eval1) {
if (ctx->Eval.Map1TextureCoord4) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 4,
&ctx->EvalMap.Map1Texture4 );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord3) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 3,
&ctx->EvalMap.Map1Texture3 );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord2) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 2,
&ctx->EvalMap.Map1Texture2 );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
}
else if (ctx->Eval.Map1TextureCoord1) {
eval1_4f( &tmp->TexCoord[0], coord, flags, 1,
&ctx->EvalMap.Map1Texture1 );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
}
}
if (ctx->Eval.Map2TextureCoord4) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 4,
&ctx->EvalMap.Map2Texture4 );
+ generated |= VERT_EVAL_C2|VERT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord3) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 3,
&ctx->EvalMap.Map2Texture3 );
+ generated |= VERT_EVAL_C2|VERT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord2) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 2,
&ctx->EvalMap.Map2Texture2 );
+ generated |= VERT_EVAL_C2|VERT_EVAL_P2;
}
else if (ctx->Eval.Map2TextureCoord1) {
eval2_4f( &tmp->TexCoord[0], coord, flags, 1,
&ctx->EvalMap.Map2Texture1 );
+ 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->TexCoord[0], flags, 0,
+ VERT_TEX0|
+ VERT_OBJ|
+ generated|
+ (VERT_EVAL_ANY&~purge_flags) );
}
if (req & VERT_NORM)
{
+ GLuint generated = 0;
+
if (!all_eval)
copy_3f( store->Normal, tmp->Normal.data, count );
tmp->Normal.data = store->Normal;
tmp->Normal.start = (GLfloat *)store->Normal;
- if (ctx->Eval.Map1Normal && any_eval1)
+ if (ctx->Eval.Map1Normal && any_eval1) {
eval1_norm( &tmp->Normal, coord, flags,
&ctx->EvalMap.Map1Normal );
+ generated |= VERT_EVAL_C1|VERT_EVAL_P1;
+ }
- if (ctx->Eval.Map2Normal && any_eval2)
+ if (ctx->Eval.Map2Normal && any_eval2) {
eval2_norm( &tmp->Normal, coord, flags,
&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( store->Normal, 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.
+ */
+ if (purge_flags) {
+ GLuint vertex = VERT_OBJ|(VERT_EVAL_ANY & ~purge_flags);
+ GLuint last_new_prim = 0;
+ GLuint new_prim_length = 0;
+ GLuint next_old_prim = 0;
+ GLuint i,j;
+ struct vertex_buffer *VB = &tnl->vb;
+
+ for (i = 0, j = 0 ; i < tnl->vb.Count ; i++) {
+ if (flags[i] & vertex) {
+ store->Elt[j++] = i;
+ new_prim_length++;
+ }
+ if (i == next_old_prim) {
+ next_old_prim += VB->PrimitiveLength[i];
+ VB->PrimitiveLength[last_new_prim] = new_prim_length;
+ VB->Primitive[j] = VB->Primitive[i];
+ last_new_prim = j;
+ }
+ }
+
+ VB->Elts = store->Elt;
+
+ _tnl_fixup_purged_eval( ctx, store );
+ }
+
+ /* Produce new flags array:
+ */
{
GLuint i;
copy_1ui( store->Flag, flags, count );
tnl->vb.Flag = store->Flag;
-
- /* This is overkill, but correct as fixup will have copied the
- * values to all vertices in the VB - we may be falsely stating
- * that some repeated values are new, but doing so is fairly
- * harmless.
- */
for (i = 0 ; i < count ; i++)
store->Flag[i] |= req;
}
-/* $Id: t_imm_fixup.c,v 1.10 2001/04/09 14:47:34 keithw Exp $ */
+/* $Id: t_imm_fixup.c,v 1.11 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "t_pipeline.h"
+static const GLuint increment[GL_POLYGON+2] = { 1,2,1,1,3,1,1,4,2,1,1 };
+static const GLuint intro[GL_POLYGON+2] = { 0,0,2,2,0,2,2,0,2,2,0 };
-static void
-fixup_4f( GLfloat data[][4], GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_4f( GLfloat data[][4], GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
}
}
-static void
-fixup_3f( float data[][3], GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_3f( float data[][3], GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
}
-static void
-fixup_1ui( GLuint *data, GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_1ui( GLuint *data, GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
}
-static void
-fixup_1f( GLfloat *data, GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_1f( GLfloat *data, GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
flag[i] |= match;
}
-static void
-fixup_1ub( GLubyte *data, GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_1ub( GLubyte *data, GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
}
-static void
-fixup_4chan( GLchan data[][4], GLuint flag[], GLuint start, GLuint match )
+void
+_tnl_fixup_4chan( GLchan data[][4], GLuint flag[], GLuint start, GLuint match )
{
GLuint i = start;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
if (fixup & VERT_TEX(i)) {
if (orflag & VERT_TEX(i))
- fixup_4f( IM->TexCoord[i], IM->Flag, start, VERT_TEX(i) );
+ _tnl_fixup_4f( IM->TexCoord[i], IM->Flag, start,
+ VERT_TEX(i) );
else
fixup_first_4f( IM->TexCoord[i], IM->Flag, VERT_END_VB, start,
IM->TexCoord[i][start]);
if (fixup & VERT_EDGE) {
if (orflag & VERT_EDGE)
- fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE );
+ _tnl_fixup_1ub( IM->EdgeFlag, IM->Flag, start, VERT_EDGE );
else
fixup_first_1ub( IM->EdgeFlag, IM->Flag, VERT_END_VB, start,
IM->EdgeFlag[start] );
if (fixup & VERT_INDEX) {
if (orflag & VERT_INDEX)
- fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX );
+ _tnl_fixup_1ui( IM->Index, IM->Flag, start, VERT_INDEX );
else
fixup_first_1ui( IM->Index, IM->Flag, VERT_END_VB, start,
IM->Index[start] );
if (fixup & VERT_RGBA) {
if (orflag & VERT_RGBA)
- fixup_4chan( IM->Color, IM->Flag, start, VERT_RGBA );
+ _tnl_fixup_4chan( IM->Color, IM->Flag, start, VERT_RGBA );
else
fixup_first_4chan( IM->Color, IM->Flag, VERT_END_VB, start,
IM->Color[start] );
if (fixup & VERT_SPEC_RGB) {
if (orflag & VERT_SPEC_RGB)
- fixup_4chan( IM->SecondaryColor, IM->Flag, start, VERT_SPEC_RGB );
+ _tnl_fixup_4chan( IM->SecondaryColor, IM->Flag, start,
+ VERT_SPEC_RGB );
else
fixup_first_4chan( IM->SecondaryColor, IM->Flag, VERT_END_VB, start,
IM->SecondaryColor[start] );
if (fixup & VERT_FOG_COORD) {
if (orflag & VERT_FOG_COORD)
- fixup_1f( IM->FogCoord, IM->Flag, start, VERT_FOG_COORD );
+ _tnl_fixup_1f( IM->FogCoord, IM->Flag, start, VERT_FOG_COORD );
else
fixup_first_1f( IM->FogCoord, IM->Flag, VERT_END_VB, start,
IM->FogCoord[start] );
if (fixup & VERT_NORM) {
if (orflag & VERT_NORM)
- fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM );
+ _tnl_fixup_3f( IM->Normal, IM->Flag, start, VERT_NORM );
else
fixup_first_3f( IM->Normal, IM->Flag, VERT_END_VB, start,
IM->Normal[start] );
void
_tnl_get_exec_copy_verts( GLcontext *ctx, struct immediate *IM )
{
- static const GLuint increment[GL_POLYGON+2] = { 1,2,1,1,3,1,1,4,2,1,1 };
- static const GLuint intro[GL_POLYGON+2] = { 0,0,2,2,0,2,2,0,2,2,0 };
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint last = IM->LastPrimitive;
}
-/* If we receive evalcoords in an immediate struct for maps which
- * don't have a vertex enabled, need to do an additional fixup, as
- * those rows containing evalcoords must now be ignored. The
- * evalcoords may still generate colors, normals, etc, so have to
- * respect the relative order between calls to EvalCoord and Normal
- * etc.
- *
- * Generate the index list that will be used to render this immediate
- * struct.
- *
- * Finally, generate a new primitives list for rendering the indices.
+/*
*/
-#if 0
-void _tnl_fixup_purged_eval( GLcontext *ctx,
- GLuint fixup, GLuint purge )
+void _tnl_fixup_purged_eval( GLcontext *ctx, struct immediate *IM )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct tnl_eval_store *store = &tnl->eval;
- GLuint *flags = tnl->vb.Flag;
- GLuint i, j, nextprim;
- GLuint fixup_fence = purge|VERT_OBJ;
- GLuint good_index = (VERT_EVAL_ANY & ~purge)|VERT_OBJ;
- GLuint prim_length = 0, lastprim = 0, nextprim = 0;
- if (fixup & VERT_TEX0)
- fixup_4f( store->TexCoord, flags, 0, VERT_TEX0|fixup_fence );
-
- if (fixup & VERT_INDEX)
- fixup_1ui( store->Index, flags, 0, VERT_INDEX|fixup_fence );
-
- if (fixup & VERT_RGBA)
- fixup_4chan( store->Color, flags, 0, VERT_RGBA|fixup_fence );
+ /* Recalculate ExecCopyElts, ExecParity, etc. These don't need the
+ * post-eval values, so using the original immediate is fine, but
+ * copied vertices will need to be re-evaluated.
+ */
+ if (tnl->CurrentPrimitive != GL_POLYGON+1) {
+ GLuint last = IM->LastPrimitive;
+ GLenum prim = IM->Primitive[last];
+ GLuint pincr = increment[prim];
+ GLuint pintro = intro[prim];
+ GLuint ovf, i;
- if (fixup & VERT_NORM)
- fixup_3f( store->Normal, flags, 0, VERT_NORM|fixup_fence );
+ tnl->ExecCopyCount = 0;
+ tnl->ExecParity = IM->PrimitiveLength[last] & 1;
- for (i = 0, j = 0 ; i < tnl->vb.Count ; i++) {
- if (flags[i] & good_index) {
- store->Elts[j++] = i;
- prim_length++;
- }
- if (i == nextprim) {
- VB->PrimitiveLength[lastprim] = prim_length;
- VB->Primitive[j] = VB->Primitive[i];
- nextprim += lastprimlen;
- lastprim = i;
- lastprimlen = VB->PrimitiveLength[i];
- }
- }
+ if (pincr != 1 && (IM->Count - last - pintro))
+ ovf = (IM->Count - last - pintro) % pincr;
- VB->Elts = store->Elts;
+ if (last < IM->Count)
+ copy_tab[prim]( tnl, last, IM->Count, ovf );
- /* What about copying??? No immediate exists with the right
- * vertices in place...
- */
- if (tnl->CurrentPrimitive != GL_POLYGON+1) {
+ for (i = 0 ; i < tnl->ExecCopyCount ; i++)
+ tnl->ExecCopyElts[i] = IM->Elt[tnl->ExecCopyElts[i]];
}
}
-#endif
-/* $Id: t_imm_fixup.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */
+/* $Id: t_imm_fixup.h,v 1.3 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "mtypes.h"
#include "t_context.h"
+extern void _tnl_fixup_4chan( GLchan data[][4], GLuint flag[],
+ GLuint start, GLuint match );
+extern void _tnl_fixup_1ub( GLubyte *data, GLuint flag[],
+ GLuint start, GLuint match );
+
+extern void _tnl_fixup_1f( GLfloat *data, GLuint flag[],
+ GLuint start, GLuint match );
+
+extern void _tnl_fixup_1ui( GLuint *data, GLuint flag[],
+ GLuint start, GLuint match );
+
+extern void _tnl_fixup_3f( float data[][3], GLuint flag[],
+ GLuint start, GLuint match );
+
+extern void _tnl_fixup_4f( GLfloat data[][4], GLuint flag[],
+ GLuint start, GLuint match );
extern void _tnl_fixup_input( GLcontext *ctx, struct immediate *IM );
struct immediate *IM );
-extern void _tnl_fixup_purged_eval( GLcontext *ctx,
- GLuint fixup, GLuint purge );
-
+extern void _tnl_fixup_purged_eval( GLcontext *ctx, struct immediate *IM );
extern void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *IM );
extern void _tnl_get_exec_copy_verts( GLcontext *ctx, struct immediate *IM );
-/* $Id: t_vb_light.c,v 1.12 2001/03/12 00:48:44 gareth Exp $ */
+/* $Id: t_vb_light.c,v 1.13 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr;
GLuint ind;
+/* _tnl_print_vert_flags( __FUNCTION__, stage->changed_inputs ); */
+
/* Make sure we can talk about elements 0..2 in the vector we are
* lighting.
*/
-/* $Id: t_vb_render.c,v 1.17 2001/03/29 16:50:33 brianp Exp $ */
+/* $Id: t_vb_render.c,v 1.18 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
tnl->Driver.RenderFinish( ctx );
+/* usleep(100000); */
return GL_FALSE; /* finished the pipe */
}
-/* $Id: t_vb_texgen.c,v 1.8 2001/03/30 14:44:44 gareth Exp $ */
+/* $Id: t_vb_texgen.c,v 1.9 2001/04/26 14:53:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
-/*
- */
static void build_m3( GLfloat f[][3], GLfloat m[],
const GLvector3f *normal,
const GLvector4f *eye )
const GLfloat *norm = normal->start;
GLuint i;
- /* KW: Had to rearrange this loop to avoid a compiler bug with gcc
- * 2.7.3.1 at -O3 optimization. Using -fno-strength-reduce
- * also fixed the bug - is this generally necessary?
- */
- for (i=0;i<count;i++,STRIDE_F(coord,stride)) {
+ for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(norm,normal->stride)) {
GLfloat u[3], two_nu, fx, fy, fz;
COPY_3V( u, coord );
NORMALIZE_3FV( u );
if (m[i] != 0.0F) {
m[i] = 0.5F / (GLfloat) GL_SQRT(m[i]);
}
-
- STRIDE_F(norm, normal->stride);
}
}
GLfloat *norm = normal->start;
GLuint i;
- for (i=0;i<count;i++,STRIDE_F(coord,stride)) {
-
+ for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(norm,normal->stride)) {
GLfloat u[3], two_nu, fx, fy, fz;
COPY_2V( u, coord );
u[2] = 0;
if (m[i] != 0.0F) {
m[i] = 0.5F / (GLfloat) GL_SQRT(m[i]);
}
-
- STRIDE_F(norm, normal->stride);
}
}
GLfloat (*f)[3] = store->tmp_f;
GLfloat *m = store->tmp_m;
+/* fprintf(stderr, "%s normstride %d eyestride %d\n", */
+/* __FUNCTION__, VB->NormalPtr->stride, */
+/* VB->EyePtr->stride); */
+
(build_m_tab[VB->EyePtr->size])( store->tmp_f,
store->tmp_m,
VB->NormalPtr,
/* Need the original input in case it contains a Q coord:
* (sigh)
*/
-/* if ((ctx->Texture.Unit[i]._ReallyEnabled|Q_BIT) & */
-/* ~ctx->Texture.Unit[i].TexGenEnabled) */
- inputs |= VERT_TEX(i);
+ inputs |= VERT_TEX(i);
/* Something for Feedback? */
}