aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-01-01 17:13:12 +0000
committerBrian Paul <[email protected]>2004-01-01 17:13:12 +0000
commit41c310b20a97a9719100f61c6871e9fd4b3ff5f9 (patch)
tree13d3d9ecf8168d63fe9588f2fbc2a9ff8da39cd1 /src/mesa/tnl
parent4d1b773dd32bc03dc386a66764217b7bdade6cf6 (diff)
whitespace changes and new comments
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_context.h5
-rw-r--r--src/mesa/tnl/t_vtx_api.c17
2 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index 33c4e06985d..1d148be214d 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -83,6 +83,11 @@
#define MAX_PIPELINE_STAGES 30
+/*
+ * Note: The first attributes match the VERT_ATTRIB_* definitions
+ * in mtypes.h. However, the tnl module has additional attributes
+ * for materials, color indexes, edge flags, etc.
+ */
enum {
_TNL_ATTRIB_POS = 0,
_TNL_ATTRIB_WEIGHT = 1,
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 482a316453c..36ba7b6dff6 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -107,13 +107,20 @@ static void _tnl_wrap_filled_vertex( GLcontext *ctx )
tnl->vtx.copied.nr = 0;
}
+
+/*
+ * Copy the active vertex's values to the ctx->Current fields.
+ */
static void _tnl_copy_to_current( GLcontext *ctx )
{
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_INDEX ; 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.
+ */
ASSIGN_4V( tnl->vtx.current[i], 0, 0, 0, 1 );
COPY_SZ_4V(tnl->vtx.current[i],
tnl->vtx.attrsz[i],
@@ -166,9 +173,6 @@ static void _tnl_copy_from_current( GLcontext *ctx )
}
-
-
-
/* Flush existing data, set new attrib size, replay copied vertices.
*/
static void _tnl_wrap_upgrade_vertex( GLcontext *ctx,
@@ -1120,14 +1124,17 @@ void _tnl_FlushVertices( GLcontext *ctx, GLuint flags )
ctx->Driver.NeedFlush = 0;
}
+
static void _tnl_current_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLint i;
+ /* setup the pointers for the typical 16 vertex attributes */
for (i = 0; i < VERT_ATTRIB_MAX; i++)
tnl->vtx.current[i] = ctx->Current.Attrib[i];
+ /* setup pointers for the 12 material attributes */
for (i = 0; i < MAT_ATTRIB_MAX; i++)
tnl->vtx.current[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] =
ctx->Light.Material.Attrib[i];
@@ -1136,8 +1143,6 @@ static void _tnl_current_init( GLcontext *ctx )
}
-
-
void _tnl_vtx_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);