diff options
author | Brian Paul <[email protected]> | 2006-06-14 04:05:17 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-06-14 04:05:17 +0000 |
commit | 62e1fae858509615c6e54e0b9388cfa2691a5919 (patch) | |
tree | 35fb599ca4b17f1c909d916e2e91d2a1b6f587c5 /src/mesa | |
parent | 62dc134771858638ac38687c16bbb0578d20c419 (diff) |
A number of vertex buffer fields like NormalPtr, FogCoordPtr, etc are really
just aliases for members of the VB->AttribPtr[] array.
Begin replacing FogCoordPtr with VB->AttribPtr[_TNL_ATTRIB_FOG], and similarly
for NormalPtr, TexCoordPtr, PointSizePtr, etc.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/tnl/t_context.h | 1 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_arbprogram.c | 28 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_arbshader.c | 31 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_cull.c | 4 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_fog.c | 14 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_lighttmp.h | 24 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_normals.c | 6 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_points.c | 1 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_program.c | 14 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_texgen.c | 20 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_texmat.c | 6 |
11 files changed, 76 insertions, 73 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 7f94f071fee..537e9ab2148 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -415,7 +415,6 @@ struct vertex_buffer GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */ GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ - GLvector4f *PointSizePtr; /* _TNL_BIT_POS */ GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ GLvector4f *VaryingPtr[MAX_VARYING_VECTORS]; diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 6c5cfb09e00..5d64aa3d922 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -1334,13 +1334,16 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) VB->ClipPtr = &m->attribs[VERT_RESULT_HPOS]; VB->ClipPtr->count = VB->Count; + /* XXX There seems to be confusion between using the VERT_ATTRIB_* + * values vs _TNL_ATTRIB_* tokens here: + */ outputs = program->Base.OutputsWritten; if (program->IsPositionInvariant) outputs |= (1<<VERT_RESULT_HPOS); if (outputs & (1<<VERT_RESULT_COL0)) { - VB->ColorPtr[0] = &m->attribs[VERT_RESULT_COL0]; - VB->AttribPtr[VERT_ATTRIB_COLOR0] = VB->ColorPtr[0]; + VB->ColorPtr[0] = + VB->AttribPtr[VERT_ATTRIB_COLOR0] = &m->attribs[VERT_RESULT_COL0]; } if (outputs & (1<<VERT_RESULT_BFC0)) { @@ -1348,8 +1351,8 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) } if (outputs & (1<<VERT_RESULT_COL1)) { - VB->SecondaryColorPtr[0] = &m->attribs[VERT_RESULT_COL1]; - VB->AttribPtr[VERT_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; + VB->SecondaryColorPtr[0] = + VB->AttribPtr[VERT_ATTRIB_COLOR1] = &m->attribs[VERT_RESULT_COL1]; } if (outputs & (1<<VERT_RESULT_BFC1)) { @@ -1357,19 +1360,18 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) } if (outputs & (1<<VERT_RESULT_FOGC)) { - VB->FogCoordPtr = &m->attribs[VERT_RESULT_FOGC]; - VB->AttribPtr[VERT_ATTRIB_FOG] = VB->FogCoordPtr; + VB->FogCoordPtr = + VB->AttribPtr[VERT_ATTRIB_FOG] = &m->attribs[VERT_RESULT_FOGC]; } if (outputs & (1<<VERT_RESULT_PSIZ)) { - VB->PointSizePtr = &m->attribs[VERT_RESULT_PSIZ]; VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &m->attribs[VERT_RESULT_PSIZ]; } for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { if (outputs & (1<<(VERT_RESULT_TEX0+i))) { - VB->TexCoordPtr[i] = &m->attribs[VERT_RESULT_TEX0 + i]; - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i]; + VB->TexCoordPtr[i] = + VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &m->attribs[VERT_RESULT_TEX0 + i]; } } @@ -1380,10 +1382,10 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) VEC_ELT(VB->ClipPtr, GLfloat, i)[1], VEC_ELT(VB->ClipPtr, GLfloat, i)[2], VEC_ELT(VB->ClipPtr, GLfloat, i)[3], - VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[0], - VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[1], - VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[2], - VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[3]); + VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[0], + VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[1], + VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[2], + VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[3]); } #endif diff --git a/src/mesa/tnl/t_vb_arbshader.c b/src/mesa/tnl/t_vb_arbshader.c index ec8dd5e2f57..174d7985432 100644 --- a/src/mesa/tnl/t_vb_arbshader.c +++ b/src/mesa/tnl/t_vb_arbshader.c @@ -236,25 +236,30 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag vb->ClipPtr = &store->outputs[VERT_RESULT_HPOS]; vb->ClipPtr->count = vb->Count; + vb->ColorPtr[0] = &store->outputs[VERT_RESULT_COL0]; - vb->SecondaryColorPtr[0] = &store->outputs[VERT_RESULT_COL1]; - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) - vb->TexCoordPtr[i] = &store->outputs[VERT_RESULT_TEX0 + i]; + vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0]; vb->ColorPtr[1] = &store->outputs[VERT_RESULT_BFC0]; + + vb->SecondaryColorPtr[0] = + vb->AttribPtr[VERT_ATTRIB_COLOR1] = &store->outputs[VERT_RESULT_COL1]; + vb->SecondaryColorPtr[1] = &store->outputs[VERT_RESULT_BFC1]; - vb->FogCoordPtr = &store->outputs[VERT_RESULT_FOGC]; - vb->PointSizePtr = &store->outputs[VERT_RESULT_PSIZ]; - for (i = 0; i < MAX_VARYING_VECTORS; i++) - vb->VaryingPtr[i] = &store->varyings[i]; - vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0]; - vb->AttribPtr[VERT_ATTRIB_COLOR1] = vb->SecondaryColorPtr[0]; - vb->AttribPtr[VERT_ATTRIB_FOG] = vb->FogCoordPtr; - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) - vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = vb->TexCoordPtr[i]; + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + vb->TexCoordPtr[i] = + vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->outputs[VERT_RESULT_TEX0 + i]; + } + + vb->FogCoordPtr = + vb->AttribPtr[VERT_ATTRIB_FOG] = &store->outputs[VERT_RESULT_FOGC]; + vb->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->outputs[VERT_RESULT_PSIZ]; - for (i = 0; i < MAX_VARYING_VECTORS; i++) + + for (i = 0; i < MAX_VARYING_VECTORS; i++) { + vb->VaryingPtr[i] = &store->varyings[i]; vb->AttribPtr[_TNL_ATTRIB_GENERIC0 + i] = vb->VaryingPtr[i]; + } store->ormask = 0; store->andmask = CLIP_FRUSTUM_BITS; diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c index b5ba68dc86d..8848dac10c1 100644 --- a/src/mesa/tnl/t_vb_cull.c +++ b/src/mesa/tnl/t_vb_cull.c @@ -52,8 +52,8 @@ static GLboolean run_cull_stage( GLcontext *ctx, const GLfloat a = ctx->Transform.CullObjPos[0]; const GLfloat b = ctx->Transform.CullObjPos[1]; const GLfloat c = ctx->Transform.CullObjPos[2]; - GLfloat *norm = (GLfloat *)VB->NormalPtr->data; - GLuint stride = VB->NormalPtr->stride; + GLfloat *norm = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; + GLuint stride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; GLuint count = VB->Count; GLuint i; diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index bbee44ebea0..51f28c4059f 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -158,8 +158,8 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) { /* Fog is computed from vertex or fragment Z values */ /* source = VB->ObjPtr or VB->EyePtr coords */ - /* dest = VB->FogCoordPtr = fog stage private storage */ - VB->FogCoordPtr = &store->fogcoord; + /* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */ + VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; if (!ctx->_NeedEyeCoords) { /* compute fog coords from object coords */ @@ -199,26 +199,26 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) } else { /* use glFogCoord() coordinates */ - input = VB->FogCoordPtr; /* source data */ + input = VB->AttribPtr[_TNL_ATTRIB_FOG]; /* source data */ /* input->count may be one if glFogCoord was only called once * before glBegin. But we need to compute fog for all vertices. */ input->count = VB->ObjPtr->count; - VB->FogCoordPtr = &store->fogcoord; /* dest data */ + VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; /* dest data */ } if (tnl->_DoVertexFog) { /* compute blend factors from fog coordinates */ - compute_fog_blend_factors( ctx, VB->FogCoordPtr, input ); + compute_fog_blend_factors( ctx, VB->AttribPtr[_TNL_ATTRIB_FOG], input ); } else { /* results = incoming fog coords (compute fog per-fragment later) */ - VB->FogCoordPtr = input; + VB->AttribPtr[_TNL_ATTRIB_FOG] = input; } - VB->AttribPtr[_TNL_ATTRIB_FOG] = VB->FogCoordPtr; + VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; return GL_TRUE; } diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index a27f708421e..a78f27761f5 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -56,8 +56,8 @@ static void TAG(light_rgba_spec)( GLcontext *ctx, const GLuint vstride = input->stride; const GLfloat *vertex = (GLfloat *)input->data; - const GLuint nstride = VB->NormalPtr->stride; - const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; + const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data; @@ -245,8 +245,8 @@ static void TAG(light_rgba)( GLcontext *ctx, const GLuint vstride = input->stride; const GLfloat *vertex = (GLfloat *) input->data; - const GLuint nstride = VB->NormalPtr->stride; - const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; + const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; #if IDX & LIGHT_TWOSIDE @@ -428,8 +428,8 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx, { struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - const GLuint nstride = VB->NormalPtr->stride; - const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; + const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; #if IDX & LIGHT_TWOSIDE GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; @@ -440,7 +440,7 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx, #if IDX & LIGHT_MATERIAL const GLuint nr = VB->Count; #else - const GLuint nr = VB->NormalPtr->count; + const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count; #endif #ifdef TRACE @@ -536,8 +536,8 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, { struct light_stage_data *store = LIGHT_STAGE_DATA(stage); GLfloat sumA[2]; - const GLuint nstride = VB->NormalPtr->stride; - const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; + const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data; #if IDX & LIGHT_TWOSIDE GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data; @@ -546,7 +546,7 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, #if IDX & LIGHT_MATERIAL const GLuint nr = VB->Count; #else - const GLuint nr = VB->NormalPtr->count; + const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count; #endif const struct gl_light *light; @@ -656,8 +656,8 @@ static void TAG(light_ci)( GLcontext *ctx, GLuint j; const GLuint vstride = input->stride; const GLfloat *vertex = (GLfloat *) input->data; - const GLuint nstride = VB->NormalPtr->stride; - const GLfloat *normal = (GLfloat *)VB->NormalPtr->data; + const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; GLfloat *indexResult[2]; const GLuint nr = VB->Count; diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index edcb4de6e94..0f91784e809 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -67,19 +67,19 @@ run_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) store->NormalTransform( ctx->ModelviewMatrixStack.Top, ctx->_ModelViewInvScale, - VB->NormalPtr, /* input normals */ + VB->AttribPtr[_TNL_ATTRIB_NORMAL], /* input normals */ lengths, &store->normal ); /* resulting normals */ - if (VB->NormalPtr->count > 1) { + if (VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count > 1) { store->normal.stride = 4 * sizeof(GLfloat); } else { store->normal.stride = 0; } + VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &store->normal; VB->NormalPtr = &store->normal; - VB->AttribPtr[_TNL_ATTRIB_NORMAL] = VB->NormalPtr; VB->NormalLengthPtr = NULL; /* no longer valid */ return GL_TRUE; diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index 0ad36079170..2f502d61d1d 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -68,7 +68,6 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) size[i][0] = pointSize * atten; /* clamping done in rasterization */ } - VB->PointSizePtr = &store->PointSize; VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize; } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 131f5ffa577..9b43aecea7f 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -156,20 +156,18 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) VB->SecondaryColorPtr[0] = &store->attribs[VERT_RESULT_COL1]; VB->SecondaryColorPtr[1] = &store->attribs[VERT_RESULT_BFC1]; VB->FogCoordPtr = &store->attribs[VERT_RESULT_FOGC]; - VB->PointSizePtr = &store->attribs[VERT_RESULT_PSIZ]; - VB->AttribPtr[VERT_ATTRIB_COLOR0] = VB->ColorPtr[0]; - VB->AttribPtr[VERT_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - VB->AttribPtr[VERT_ATTRIB_FOG] = VB->FogCoordPtr; + VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->attribs[VERT_RESULT_COL0]; + VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->attribs[VERT_RESULT_COL1]; + VB->AttribPtr[VERT_ATTRIB_FOG] = &store->attribs[VERT_RESULT_FOGC]; VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->attribs[VERT_RESULT_PSIZ]; for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = - &store->attribs[VERT_RESULT_TEX0 + i]; + VB->TexCoordPtr[i] = + VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] + = &store->attribs[VERT_RESULT_TEX0 + i]; } - - /* Cliptest and perspective divide. Clip functions must clear * the clipmask. */ diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index bfb7a503691..5f7b2dccd8f 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -254,12 +254,12 @@ static void texgen_reflection_map_nv( GLcontext *ctx, GLuint unit ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->TexCoordPtr[unit]; + GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; GLvector4f *out = &store->texcoord[unit]; build_f_tab[VB->EyePtr->size]( out->start, out->stride, - VB->NormalPtr, + VB->AttribPtr[_TNL_ATTRIB_NORMAL], VB->EyePtr ); out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; @@ -276,9 +276,9 @@ static void texgen_normal_map_nv( GLcontext *ctx, GLuint unit ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->TexCoordPtr[unit]; + GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; GLvector4f *out = &store->texcoord[unit]; - GLvector4f *normal = VB->NormalPtr; + GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start; GLuint count = VB->Count; GLuint i; @@ -304,7 +304,7 @@ static void texgen_sphere_map( GLcontext *ctx, GLuint unit ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLvector4f *in = VB->TexCoordPtr[unit]; + GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; GLvector4f *out = &store->texcoord[unit]; GLfloat (*texcoord)[4] = (GLfloat (*)[4]) out->start; GLuint count = VB->Count; @@ -314,7 +314,7 @@ static void texgen_sphere_map( GLcontext *ctx, (build_m_tab[VB->EyePtr->size])( store->tmp_f, store->tmp_m, - VB->NormalPtr, + VB->AttribPtr[_TNL_ATTRIB_NORMAL], VB->EyePtr ); out->size = MAX2(in->size,2); @@ -338,12 +338,12 @@ static void texgen( GLcontext *ctx, { TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLvector4f *in = VB->TexCoordPtr[unit]; + GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; GLvector4f *out = &store->texcoord[unit]; const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const GLvector4f *obj = VB->ObjPtr; const GLvector4f *eye = VB->EyePtr; - const GLvector4f *normal = VB->NormalPtr; + const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; const GLfloat *m = store->tmp_m; const GLuint count = VB->Count; GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; @@ -501,8 +501,8 @@ static GLboolean run_texgen_stage( GLcontext *ctx, store->TexgenFunc[i]( ctx, store, i ); - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = - VB->TexCoordPtr[i] = &store->texcoord[i]; + VB->TexCoordPtr[i] = + VB->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->texcoord[i]; } } diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 1feb0b750ef..fa9222c0f14 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -74,10 +74,10 @@ static GLboolean run_texmat_stage( GLcontext *ctx, if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) { (void) TransformRaw( &store->texcoord[i], ctx->TextureMatrixStack[i].Top, - VB->TexCoordPtr[i]); + VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]); - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = - VB->TexCoordPtr[i] = &store->texcoord[i]; + VB->TexCoordPtr[i] = + VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &store->texcoord[i]; } } |