diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-04-22 12:51:19 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-04-22 12:51:19 +0000 |
commit | 6f973f33679e034b7cb63806f1ddfabdbdd70123 (patch) | |
tree | 31580bc32d1b87a3dddd8f7c8bc5f404b407c637 /src/mesa/tnl/t_array_import.c | |
parent | 6a13c7da4c79f7e811fbddc68f59441070ff0cc8 (diff) |
Simplify the pipeline_stage structure
- remove input/output fields, input tracking removed.
- remove state fields, the validate function now called
on every statechange.
- add an explicit 'create' function.
Add in code to build vertex program to implement current t&l state. Still
disabled, but turn on with a #define in t_vp_build.h.
Diffstat (limited to 'src/mesa/tnl/t_array_import.c')
-rw-r--r-- | src/mesa/tnl/t_array_import.c | 78 |
1 files changed, 30 insertions, 48 deletions
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 00a933ede5..09b3013205 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -244,7 +244,6 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) { TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLuint inputs = tnl->pipeline.inputs; struct tnl_vertex_arrays *tmp = &tnl->array_inputs; GLuint i, index; @@ -269,77 +268,61 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) } /* use conventional arrays... */ else if (index == VERT_ATTRIB_POS) { - if (inputs & _TNL_BIT_POS) { - _tnl_import_vertex( ctx, 0, 0 ); - tmp->Obj.count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_POS] = &tmp->Obj; - } + _tnl_import_vertex( ctx, 0, 0 ); + tmp->Obj.count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_POS] = &tmp->Obj; } else if (index == VERT_ATTRIB_NORMAL) { - if (inputs & _TNL_BIT_NORMAL) { - _tnl_import_normal( ctx, 0, 0 ); - tmp->Normal.count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &tmp->Normal; - } + _tnl_import_normal( ctx, 0, 0 ); + tmp->Normal.count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &tmp->Normal; } else if (index == VERT_ATTRIB_COLOR0) { - if (inputs & _TNL_BIT_COLOR0) { - _tnl_import_color( ctx, 0, 0 ); - tmp->Color.count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &tmp->Color; - } + _tnl_import_color( ctx, 0, 0 ); + tmp->Color.count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &tmp->Color; } else if (index == VERT_ATTRIB_COLOR1) { - if (inputs & _TNL_BIT_COLOR1) { - _tnl_import_secondarycolor( ctx, 0, 0 ); - tmp->SecondaryColor.count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &tmp->SecondaryColor; - } + _tnl_import_secondarycolor( ctx, 0, 0 ); + tmp->SecondaryColor.count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &tmp->SecondaryColor; } else if (index == VERT_ATTRIB_FOG) { - if (inputs & _TNL_BIT_FOG) { - _tnl_import_fogcoord( ctx, 0, 0 ); - tmp->FogCoord.count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_FOG] = &tmp->FogCoord; - } + _tnl_import_fogcoord( ctx, 0, 0 ); + tmp->FogCoord.count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_FOG] = &tmp->FogCoord; } else if (index >= VERT_ATTRIB_TEX0 && index <= VERT_ATTRIB_TEX7) { - if (inputs & _TNL_BITS_TEX_ANY) { - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (inputs & _TNL_BIT_TEX(i)) { - _tnl_import_texcoord( ctx, i, GL_FALSE, GL_FALSE ); - tmp->TexCoord[i].count = VB->Count; - VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] = &tmp->TexCoord[i]; - } - } - } + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { + _tnl_import_texcoord( ctx, i, GL_FALSE, GL_FALSE ); + tmp->TexCoord[i].count = VB->Count; + VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] = &tmp->TexCoord[i]; + } } } /* odd-ball vertex attributes */ - if (inputs & _TNL_BIT_INDEX) { + { _tnl_import_index( ctx, 0, 0 ); tmp->Index.count = VB->Count; VB->AttribPtr[_TNL_ATTRIB_INDEX] = &tmp->Index; } - if (inputs & _TNL_BIT_EDGEFLAG) { + { _tnl_import_edgeflag( ctx, GL_TRUE, sizeof(GLboolean) ); VB->EdgeFlag = (GLboolean *) tmp->EdgeFlag; } /* These are constant & can be precalculated: */ - if (inputs & _TNL_BITS_MAT_ANY) { - for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT; i < _TNL_ATTRIB_INDEX; i++) { - tmp->Attribs[i].count = 1; - tmp->Attribs[i].data = (GLfloat (*)[4]) tnl->vtx.current[i]; - tmp->Attribs[i].start = tnl->vtx.current[i]; - tmp->Attribs[i].size = 4; - tmp->Attribs[i].stride = 0; - VB->AttribPtr[i] = &tmp->Attribs[i]; - } - } + for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT; i < _TNL_ATTRIB_INDEX; i++) { + tmp->Attribs[i].count = 1; + tmp->Attribs[i].data = (GLfloat (*)[4]) tnl->vtx.current[i]; + tmp->Attribs[i].start = tnl->vtx.current[i]; + tmp->Attribs[i].size = 4; + tmp->Attribs[i].stride = 0; + VB->AttribPtr[i] = &tmp->Attribs[i]; + } /* Legacy pointers -- remove one day. @@ -357,5 +340,4 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLint end) for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]; } - } |