tnl: Replace deprecated ObjPtr with AttribPtr[_TNL_ATTRIB_POS]
authorEric Anholt <eric@anholt.net>
Wed, 18 Nov 2009 07:27:13 +0000 (23:27 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 19 Nov 2009 10:47:05 +0000 (11:47 +0100)
13 files changed:
src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
src/mesa/drivers/dri/radeon/radeon_maos_verts.c
src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
src/mesa/tnl/t_context.h
src/mesa/tnl/t_draw.c
src/mesa/tnl/t_vb_fog.c
src/mesa/tnl/t_vb_light.c
src/mesa/tnl/t_vb_texgen.c
src/mesa/tnl/t_vb_vertex.c
src/mesa/x86/gen_matypes.c

index 1cd1d6e77809003d81f15931e70c4d6be38c8979..74b66900c9ab361955f297a29547c997540be763 100644 (file)
@@ -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;
index cb57416c3e25023f16b4f6e4efa0c0044c6a1933..efb06db80e6b493df73f660850d68750a63c8c77 100644 (file)
@@ -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]) {
index a6aff69aac5cb96e1f72805e81d51a2c8956cc0c..5ed11d0a9db6ac94bef48bb382982aa193e16345 100644 (file)
@@ -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;
    }
 
 
index aa2e7e3a8df75faf2770f87c3d4611df9bd3057a..46e652dc73bea0701d1a4974d53d194447af1fdb 100644 (file)
        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];
index 7cc2ef6f3045f6ec53c48bdfa533eeda7209722d..b95351553ca7404def8662e444847c37cea65d55 100644 (file)
        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];
index 3b8af8546eb6156fc111e1e45fe8eb1c24fc6bbd..1b84cdee2855ad21103a8771b1a1eb3adb79f31b 100644 (file)
        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];
index d2b13f1b02086d5e6a5d6e0723d0a53f9b367212..bfba09fd5600dbd6f7e8650ee046b91083d44a85 100644 (file)
@@ -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 */
index 202c6ae3ce64123f71b5c2ede367d796e8280808..2a293243e5a30d480b998a0249a306572bebaf0c 100644 (file)
@@ -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];
index f3a7bd49f40189a4ca81ebc92e0365a9d315138a..a68310de4d293445a5590835e61e009442715d09 100644 (file)
@@ -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 */
    }
index f47f99397c9ad29bf59664884f66325f1d25d879..360452192d504a5f912e1903d0011ef69535c845 100644 (file)
@@ -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 );
 
index 83b74c0ebf3cf71a9cfef413754419cdb2ef827f..9ef13bc96d87cadb66f2f604779b30dbf77b9c3b 100644 (file)
@@ -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;
index 4734754ea4016dd470fdf9466a109230387f29d8..bc7e0951ec8c93c47bf011d586ceda5c6816df62 100644 (file)
@@ -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...
     */
index a70fdc1fa0386cdb586ff54b88f8a748ad03c611..61d6d16a76e9ea4e25eb6b6f33844e863a015004 100644 (file)
@@ -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 );