diff options
author | Eric Anholt <[email protected]> | 2009-11-17 23:38:35 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-11-19 11:47:05 +0100 |
commit | fc9a2970dc539b21b035ea0a770ec69822962145 (patch) | |
tree | 2b5e96f0bc0ac1540936dfc349e082de2e839d11 /src/mesa | |
parent | 165b860da6f16ef4817a4959774a57f57ba3756d (diff) |
tnl: Replace deprecated IndexPtr[] with AttribPtr[] or new BackfaceIndexPtr
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/swrast_setup/ss_tritmp.h | 2 | ||||
-rw-r--r-- | src/mesa/tnl/t_context.h | 7 | ||||
-rw-r--r-- | src/mesa/tnl/t_draw.c | 3 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_light.c | 1 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_lighttmp.h | 8 | ||||
-rw-r--r-- | src/mesa/tnl/t_vertex_generic.c | 12 | ||||
-rw-r--r-- | src/mesa/tnl_dd/t_dd_tritmp.h | 4 | ||||
-rw-r--r-- | src/mesa/x86/gen_matypes.c | 2 |
8 files changed, 20 insertions, 19 deletions
diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 724b5e94fa5..9700cf8c542 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -127,7 +127,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0]; saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index bfba09fd560..b41cf93897a 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -198,7 +198,10 @@ struct vertex_buffer */ GLuint Count; /**< Number of vertices currently in buffer */ - /* Pointers to current data. + /* Pointers to current data. Most of the data is in AttribPtr -- all of + * it that is one of VERT_ATTRIB_X. For things only produced by TNL, + * such as backface color or eye-space coordinates, they are stored + * here. * XXX some of these fields alias AttribPtr below and should be removed * such as FogCoordPtr, etc. */ @@ -211,7 +214,7 @@ struct vertex_buffer GLubyte *ClipMask; /* _TNL_BIT_POS */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ - GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */ + GLvector4f *BackfaceIndexPtr; /* _TNL_BIT_INDEX */ GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 2a293243e5a..80926276459 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -256,8 +256,7 @@ static void bind_inputs( GLcontext *ctx, */ VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->ColorPtr[1] = NULL; - VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; - VB->IndexPtr[1] = NULL; + VB->BackfaceIndexPtr = NULL; VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1]; VB->SecondaryColorPtr[1] = NULL; VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 360452192d5..e72a807f0df 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -248,7 +248,6 @@ static GLboolean run_lighting( GLcontext *ctx, VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0]; VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = VB->IndexPtr[0]; return GL_TRUE; } diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 124ca3c74fe..dd117e435cd 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -665,14 +665,14 @@ static void TAG(light_ci)( GLcontext *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->IndexPtr[0] = &store->LitIndex[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = &store->LitIndex[0]; #if IDX & LIGHT_TWOSIDE - VB->IndexPtr[1] = &store->LitIndex[1]; + VB->BackfaceIndexPtr = &store->LitIndex[1]; #endif - indexResult[0] = (GLfloat *)VB->IndexPtr[0]->data; + indexResult[0] = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]->data; #if IDX & LIGHT_TWOSIDE - indexResult[1] = (GLfloat *)VB->IndexPtr[1]->data; + indexResult[1] = (GLfloat *)VB->BackfaceIndexPtr->data; #endif /* loop over vertices */ diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 9812f8c8081..f97ad7c2ed3 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -1115,10 +1115,10 @@ void _tnl_generic_interp_extras( GLcontext *ctx, VB->SecondaryColorPtr[1]->data[in] ); } - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = LINTERP( t, - VB->IndexPtr[1]->data[out][0], - VB->IndexPtr[1]->data[in][0] ); + if (VB->BackfaceIndexPtr) { + VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t, + VB->BackfaceIndexPtr->data[out][0], + VB->BackfaceIndexPtr->data[in][0] ); } if (VB->EdgeFlag) { @@ -1145,8 +1145,8 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx, VB->SecondaryColorPtr[1]->data[src] ); } - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0]; + if (VB->BackfaceIndexPtr) { + VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0]; } _tnl_generic_copy_pv(ctx, dst, src); diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 1ae70f4059f..0e3bc1329d7 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -237,7 +237,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } else { - GLfloat (*vbindex) = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat (*vbindex) = (GLfloat *)VB->BackfaceIndexPtr->data; if (!DO_FLAT) { VERT_SAVE_IND( 0 ); VERT_SAVE_IND( 1 ); @@ -506,7 +506,7 @@ static void TAG(quadr)( GLcontext *ctx, } } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; if (!DO_FLAT) { VERT_SAVE_IND( 0 ); VERT_SAVE_IND( 1 ); diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index 61d6d16a76e..5355c268742 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -132,7 +132,7 @@ int main( int argc, char **argv ) OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX1] ); OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] ); OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] ); - OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr ); + OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] ); OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); |