From 165b860da6f16ef4817a4959774a57f57ba3756d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 23:27:13 -0800 Subject: [PATCH] tnl: Replace deprecated ObjPtr with AttribPtr[_TNL_ATTRIB_POS] --- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 8 ++++---- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 4 ++-- src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 16 ++++++++-------- .../windows/gldirect/dx7/gld_primitive_dx7.c | 2 +- .../windows/gldirect/dx8/gld_primitive_dx8.c | 2 +- .../windows/gldirect/dx9/gld_primitive_dx9.c | 2 +- src/mesa/tnl/t_context.h | 1 - src/mesa/tnl/t_draw.c | 1 - src/mesa/tnl/t_vb_fog.c | 13 +++++++------ src/mesa/tnl/t_vb_light.c | 10 +++++----- src/mesa/tnl/t_vb_texgen.c | 2 +- src/mesa/tnl/t_vb_vertex.c | 6 +++--- src/mesa/x86/gen_matypes.c | 2 +- 13 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 1cd1d6e7780..74b66900c9a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -196,12 +196,12 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.obj.buf) rcommon_emit_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->ObjPtr->data, - VB->ObjPtr->size, - VB->ObjPtr->stride, + (char *)VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, count); - switch( VB->ObjPtr->size ) { + switch( VB->AttribPtr[_TNL_ATTRIB_POS]->size ) { case 4: vfmt |= RADEON_CP_VC_FRMT_W0; case 3: vfmt |= RADEON_CP_VC_FRMT_Z; case 2: vfmt |= RADEON_CP_VC_FRMT_XY; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index cb57416c3e2..efb06db80e6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -56,8 +56,8 @@ static void TAG(emit)( GLcontext *ctx, radeon_print(RADEON_SWRENDER, RADEON_VERBOSE, "%s\n", __FUNCTION__); - coord = (GLuint (*)[4])VB->ObjPtr->data; - coord_stride = VB->ObjPtr->stride; + coord = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_POS]->data; + coord_stride = VB->AttribPtr[_TNL_ATTRIB_POS]->stride; if (DO_TEX2) { if (VB->AttribPtr[_TNL_ATTRIB_TEX2]) { diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index a6aff69aac5..5ed11d0a9db 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -326,7 +326,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (1) { req |= RADEON_CP_VC_FRMT_Z; - if (VB->ObjPtr->size == 4) { + if (VB->AttribPtr[_TNL_ATTRIB_POS]->size == 4) { req |= RADEON_CP_VC_FRMT_W0; } } @@ -390,19 +390,19 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) * this, add more vertex code (for obj-2, obj-3) or preferably move * to maos. */ - if (VB->ObjPtr->size < 3 || - (VB->ObjPtr->size == 3 && + if (VB->AttribPtr[_TNL_ATTRIB_POS]->size < 3 || + (VB->AttribPtr[_TNL_ATTRIB_POS]->size == 3 && (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0))) { _math_trans_4f( rmesa->tcl.ObjClean.data, - VB->ObjPtr->data, - VB->ObjPtr->stride, + VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, GL_FLOAT, - VB->ObjPtr->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, 0, VB->Count ); - switch (VB->ObjPtr->size) { + switch (VB->AttribPtr[_TNL_ATTRIB_POS]->size) { case 1: _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 1); case 2: @@ -416,7 +416,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) break; } - VB->ObjPtr = &rmesa->tcl.ObjClean; + VB->AttribPtr[_TNL_ATTRIB_POS] = &rmesa->tcl.ObjClean; } diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c index aa2e7e3a8df..46e652dc73b 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c index 7cc2ef6f304..b95351553ca 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c index 3b8af8546eb..1b84cdee285 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index d2b13f1b020..bfba09fd560 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -203,7 +203,6 @@ struct vertex_buffer * such as FogCoordPtr, etc. */ GLuint *Elts; - GLvector4f *ObjPtr; /* _TNL_BIT_POS */ GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 202c6ae3ce6..2a293243e5a 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -254,7 +254,6 @@ static void bind_inputs( GLcontext *ctx, /* Legacy pointers -- remove one day. */ - VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS]; VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->ColorPtr[1] = NULL; VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index f3a7bd49f40..a68310de4d2 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -156,7 +156,7 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) GLuint i; GLfloat *coord; /* Fog is computed from vertex or fragment Z values */ - /* source = VB->ObjPtr or VB->EyePtr coords */ + /* source = VB->AttribPtr[_TNL_ATTRIB_POS] or VB->EyePtr coords */ /* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */ VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; @@ -176,11 +176,12 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) /* Full eye coords weren't required, just calculate the * eye Z values. */ - _mesa_dotprod_tab[VB->ObjPtr->size]( (GLfloat *) input->data, - 4 * sizeof(GLfloat), - VB->ObjPtr, plane ); + _mesa_dotprod_tab[VB->AttribPtr[_TNL_ATTRIB_POS]->size] + ( (GLfloat *) input->data, + 4 * sizeof(GLfloat), + VB->AttribPtr[_TNL_ATTRIB_POS], plane ); - input->count = VB->ObjPtr->count; + input->count = VB->AttribPtr[_TNL_ATTRIB_POS]->count; /* make sure coords are really positive NOTE should avoid going through array twice */ @@ -213,7 +214,7 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) /* 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; + input->count = VB->AttribPtr[_TNL_ATTRIB_POS]->count; VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; /* dest data */ } diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index f47f99397c9..360452192d5 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -200,7 +200,7 @@ static GLboolean run_lighting( GLcontext *ctx, struct light_stage_data *store = LIGHT_STAGE_DATA(stage); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr; + GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->AttribPtr[_TNL_ATTRIB_POS]; GLuint idx; if (!ctx->Light.Enabled || ctx->VertexProgram._Current) @@ -208,13 +208,13 @@ static GLboolean run_lighting( GLcontext *ctx, /* Make sure we can talk about position x,y and z: */ - if (input->size <= 2 && input == VB->ObjPtr) { + if (input->size <= 2 && input == VB->AttribPtr[_TNL_ATTRIB_POS]) { _math_trans_4f( store->Input.data, - VB->ObjPtr->data, - VB->ObjPtr->stride, + VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, GL_FLOAT, - VB->ObjPtr->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, 0, VB->Count ); diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 83b74c0ebf3..9ef13bc96d8 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -341,7 +341,7 @@ static void texgen( GLcontext *ctx, 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 *obj = VB->AttribPtr[_TNL_ATTRIB_POS]; const GLvector4f *eye = VB->EyePtr; const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; const GLfloat *m = store->tmp_m; diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 4734754ea40..bc7e0951ec8 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -152,16 +152,16 @@ static GLboolean run_vertex_stage( GLcontext *ctx, * Use combined ModelProject to avoid some depth artifacts */ if (ctx->ModelviewMatrixStack.Top->type == MATRIX_IDENTITY) - VB->EyePtr = VB->ObjPtr; + VB->EyePtr = VB->AttribPtr[_TNL_ATTRIB_POS]; else VB->EyePtr = TransformRaw( &store->eye, ctx->ModelviewMatrixStack.Top, - VB->ObjPtr); + VB->AttribPtr[_TNL_ATTRIB_POS]); } VB->ClipPtr = TransformRaw( &store->clip, &ctx->_ModelProjectMatrix, - VB->ObjPtr ); + VB->AttribPtr[_TNL_ATTRIB_POS] ); /* Drivers expect this to be clean to element 4... */ diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index a70fdc1fa03..61d6d16a76e 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -120,7 +120,7 @@ int main( int argc, char **argv ) OFFSET( "VB_COUNT ", struct vertex_buffer, Count ); printf( "\n" ); OFFSET( "VB_ELTS ", struct vertex_buffer, Elts ); - OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, ObjPtr ); + OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_POS] ); OFFSET( "VB_EYE_PTR ", struct vertex_buffer, EyePtr ); OFFSET( "VB_CLIP_PTR ", struct vertex_buffer, ClipPtr ); OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr ); -- 2.30.2