GLfloat vertex[_TNL_ATTRIB_MAX*4]; /* current vertex */
GLfloat *attrptr[_TNL_ATTRIB_MAX]; /* points into vertex */
GLfloat *current[_TNL_ATTRIB_MAX]; /* points into ctx->Current, etc */
+ GLfloat CurrentFloatEdgeFlag;
GLuint counter, initial_counter;
struct tnl_copied_vtx copied;
GLuint opcode_vertex_list;
struct tnl_copied_vtx copied;
+
+ GLfloat CurrentFloatEdgeFlag;
GLfloat *current[_TNL_ATTRIB_MAX]; /* points into ctx->ListState */
GLubyte *currentsz[_TNL_ATTRIB_MAX];
}
}
- /* Edgeflag requires special treatment:
+ /* Edgeflag requires special treatment:
+ *
+ * TODO: change edgeflag to GLfloat in Mesa.
*/
if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
ctx->ListState.ActiveEdgeFlag = 1;
+ tnl->save.CurrentFloatEdgeFlag =
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0];
ctx->ListState.CurrentEdgeFlag =
- (tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] == 1.0);
+ (tnl->save.CurrentFloatEdgeFlag == 1.0);
}
}
/* Edgeflag requires special treatment:
*/
- if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG])
- tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] =
- (GLfloat)ctx->ListState.CurrentEdgeFlag;
+ if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ tnl->save.CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag;
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] = tnl->save.CurrentFloatEdgeFlag;
+ }
}
if (tnl->save.currentsz[attr][0] == 0) {
assert(oldsz == 0);
tnl->save.dangling_attr_ref = GL_TRUE;
- _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n",
- attr);
+
+/* _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n", */
+/* attr); */
#if 0
/* The current strategy is to punt these degenerate cases
tnl->save.currentsz[_TNL_ATTRIB_INDEX] = &ctx->ListState.ActiveIndex;
tnl->save.current[_TNL_ATTRIB_INDEX] = &ctx->ListState.CurrentIndex;
- /* Current edgeflag is handled individually */
+ tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
+ tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag;
}
/**
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint i;
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++)
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++)
if (tnl->vtx.attrsz[i]) {
/* Note: the tnl->vtx.current[i] pointers points to
* the ctx->Current fields. The first 16 or so, anyway.
tnl->vtx.attrptr[i]);
}
- /* Edgeflag requires special treatment:
+ /* Edgeflag requires additional treatment:
*/
- if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG])
+ if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
ctx->Current.EdgeFlag =
- (tnl->vtx.attrptr[_TNL_ATTRIB_EDGEFLAG][0] == 1.0);
-
+ (tnl->vtx.CurrentFloatEdgeFlag == 1.0);
+ }
/* Colormaterial -- this kindof sucks.
*/
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLint i;
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++)
+ /* Edgeflag requires additional treatment:
+ */
+ tnl->vtx.CurrentFloatEdgeFlag =
+ (GLfloat)ctx->Current.EdgeFlag;
+
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_MAX ; i++)
switch (tnl->vtx.attrsz[i]) {
case 4: tnl->vtx.attrptr[i][3] = tnl->vtx.current[i][3];
case 3: tnl->vtx.attrptr[i][2] = tnl->vtx.current[i][2];
break;
}
- /* Edgeflag requires special treatment:
- */
- if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG])
- tnl->vtx.attrptr[_TNL_ATTRIB_EDGEFLAG][0] =
- (GLfloat)ctx->Current.EdgeFlag;
-
-
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
}
ctx->Light.Material.Attrib[i];
tnl->vtx.current[_TNL_ATTRIB_INDEX] = &ctx->Current.Index;
+ tnl->vtx.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->vtx.CurrentFloatEdgeFlag;
}
static struct _tnl_dynfn *no_codegen( GLcontext *ctx, int key )