tnl: Replace deprecated ColorPtr[] with AttribPtr or new BackfaceColorPtr.
authorEric Anholt <eric@anholt.net>
Wed, 18 Nov 2009 09:38:55 +0000 (01:38 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 19 Nov 2009 10:47:05 +0000 (11:47 +0100)
30 files changed:
src/mesa/drivers/dri/ffb/ffb_vbtmp.h
src/mesa/drivers/dri/gamma/gamma_render.c
src/mesa/drivers/dri/mach64/mach64_native_vb.c
src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
src/mesa/drivers/dri/mach64/mach64_vbtmp.h
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/radeon/radeon_maos_arrays.c
src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
src/mesa/drivers/dri/tdfx/tdfx_vb.c
src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h
src/mesa/drivers/glide/fxvb.c
src/mesa/drivers/glide/fxvbtmp.h
src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c
src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c
src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c
src/mesa/swrast_setup/ss_tritmp.h
src/mesa/tnl/t_context.h
src/mesa/tnl/t_draw.c
src/mesa/tnl/t_vb_light.c
src/mesa/tnl/t_vb_lighttmp.h
src/mesa/tnl/t_vb_program.c
src/mesa/tnl/t_vertex_generic.c
src/mesa/tnl_dd/t_dd_dmatmp.h
src/mesa/tnl_dd/t_dd_tritmp.h
src/mesa/tnl_dd/t_dd_vb.c
src/mesa/tnl_dd/t_dd_vbtmp.h
src/mesa/x86/gen_matypes.c

index 0495d0e2767d900dd86d5aca31c6549fae9cfe76..c548ef3ad58fc35b709ce61c439ed38bea5251d4 100644 (file)
@@ -38,11 +38,11 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
 #endif
 
 #if (IND & (FFB_VB_RGBA_BIT))
-       col0 = VB->ColorPtr[0]->data;
-       col0_stride = VB->ColorPtr[0]->stride;
+       col0 = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+       col0_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
 #if (IND & (FFB_VB_TWOSIDE_BIT))
-       col1 = VB->ColorPtr[1]->data;
-       col1_stride = VB->ColorPtr[1]->stride;
+       col1 = VB->BackfaceColorPtr->data;
+       col1_stride = VB->BackfaceColorPtr->stride;
 #endif
 #endif
 
index 741936488ac2e299c63edffe17930a81a9ec85b3..a03a93d132cf1c1099abefc3ab40100428d2e888 100644 (file)
@@ -53,8 +53,8 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end)
    GLfloat (*tc0)[4] = 0;
    GLuint tc0_size = 0;
 
-   col = VB->ColorPtr[0]->data;
-   col_stride = VB->ColorPtr[0]->stride;
+   col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+   col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
 
    if (ctx->Texture.Unit[0]._ReallyEnabled) {
       tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride;
index 99f1a14e171c25ab644df7b099a6389cd4e1e96b..816682ec5f13d3b0f6f2d2fbe3a0d16866cd51d7 100644 (file)
@@ -207,19 +207,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
    LOCALVARS
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-      assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
+   if (VB->BackfaceColorPtr) {
+      assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
       
       INTERP_4F( t,
-                   GET_COLOR(VB->ColorPtr[1], dst),
-                   GET_COLOR(VB->ColorPtr[1], out),
-                   GET_COLOR(VB->ColorPtr[1], in) );
+                GET_COLOR(VB->BackfaceColorPtr, dst),
+                GET_COLOR(VB->BackfaceColorPtr, out),
+                GET_COLOR(VB->BackfaceColorPtr, in) );
 
-      if (VB->SecondaryColorPtr[1]) {
+      if (VB->BackfaceSecondaryColorPtr) {
         INTERP_3F( t,
-                      GET_COLOR(VB->SecondaryColorPtr[1], dst),
-                      GET_COLOR(VB->SecondaryColorPtr[1], out),
-                      GET_COLOR(VB->SecondaryColorPtr[1], in) );
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, in) );
       }
    }
 
@@ -236,13 +236,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
    LOCALVARS
       struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-      COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), 
-               GET_COLOR(VB->ColorPtr[1], src) );
+   if (VB->BackfaceColorPtr) {
+      COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
+               GET_COLOR(VB->BackfaceColorPtr, src) );
 
-      if (VB->SecondaryColorPtr[1]) {
-        COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), 
-                  GET_COLOR(VB->SecondaryColorPtr[1], src) );
+      if (VB->BackfaceSecondaryColorPtr) {
+        COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                  GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
       }
    }
 
index 1a93e5f034e280051362c9fd84bfddab0c4f55b2..2af84fa9b639e602aa134a0999036aea56ac0480 100644 (file)
@@ -123,9 +123,9 @@ static void TAG(emit)( GLcontext *ctx,
 #endif
 
 #if DO_SPEC
-   if (VB->SecondaryColorPtr[0]) {
-      spec = VB->SecondaryColorPtr[0]->data;
-      spec_stride = VB->SecondaryColorPtr[0]->stride;
+   if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
+      spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
+      spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
    } else {
       spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
       spec_stride = 0;
@@ -144,8 +144,8 @@ static void TAG(emit)( GLcontext *ctx,
 #endif
 
 #if DO_RGBA
-   col = VB->ColorPtr[0]->data;
-   col_stride = VB->ColorPtr[0]->stride;
+   col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+   col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
 #endif
 
    coord = VB->NdcPtr->data;
index eb94e6e3983a0368bc04a51fa4dbae317871c154..636b7de80f8b1ac0f4d59bbe67f7764174c39f4a 100644 (file)
@@ -187,13 +187,13 @@ static void TAG(emit)( GLcontext *ctx,
    }
 
    if (DO_RGBA) {
-      col = VB->ColorPtr[0]->data;
-      col_stride = VB->ColorPtr[0]->stride;
+      col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+      col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
    }
 
    if (DO_SPEC) {
-      spec = VB->SecondaryColorPtr[0]->data;
-      spec_stride = VB->SecondaryColorPtr[0]->stride;
+      spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
+      spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
    } else {
       spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
       spec_stride = 0;
@@ -384,8 +384,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
 
    ASSERT(stride == 4);
 
-   col = VB->ColorPtr[0]->data;
-   col_stride = VB->ColorPtr[0]->stride;
+   col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+   col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
 
    /* Pack what's left into a 4-dword vertex.  Color is in a different
     * place, and there is no 'w' coordinate.
@@ -432,8 +432,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
    GLfloat *v = (GLfloat *)dest;
    int i;
 
-   col = VB->ColorPtr[0]->data;
-   col_stride = VB->ColorPtr[0]->stride;
+   col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+   col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
 
    if (start)
       STRIDE_4F(col, col_stride * start);
index 677c504b907875c1eedba92e26653d69d5f06627..99bd22edac6c605973a11077c568e9d98512a848 100644 (file)
@@ -124,7 +124,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead,  GLuint *_
        }
 
        if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
-               VB->AttribPtr[VERT_ATTRIB_GENERIC0] = VB->ColorPtr[1];
+               VB->AttribPtr[VERT_ATTRIB_GENERIC0] = VB->BackfaceColorPtr;
                OutputsWritten |= 1 << VERT_RESULT_BFC0;
 #if MESA_LITTLE_ENDIAN
                EMIT_ATTR( _TNL_ATTRIB_GENERIC0, EMIT_4UB_4F_RGBA );
@@ -134,7 +134,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead,  GLuint *_
                ADD_ATTR(VERT_ATTRIB_GENERIC0, R300_DATA_TYPE_BYTE, SWTCL_OVM_COLOR2, SWIZZLE_XYZW, MASK_XYZW, 1);
 #endif
                if (fp_reads & FRAG_BIT_COL1) {
-                       VB->AttribPtr[VERT_ATTRIB_GENERIC1] = VB->SecondaryColorPtr[1];
+                       VB->AttribPtr[VERT_ATTRIB_GENERIC1] = VB->BackfaceSecondaryColorPtr;
                        GLuint swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE);
                        OutputsWritten |= 1 << VERT_RESULT_BFC1;
 #if MESA_LITTLE_ENDIAN
index 74b66900c9ab361955f297a29547c997540be763..8b51af81a6ceb486575daf4efb68969e90f6b1ae 100644 (file)
@@ -227,9 +227,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
 
    if (inputs & VERT_BIT_COLOR0) {
       int emitsize;
-      if (VB->ColorPtr[0]->size == 4 &&
-         (VB->ColorPtr[0]->stride != 0 ||
-          VB->ColorPtr[0]->data[0][3] != 1.0)) {
+      if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size == 4 &&
+         (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0 ||
+          VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data[0][3] != 1.0)) {
         vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA;
         emitsize = 4;
       }
@@ -242,9 +242,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
       if (!rmesa->tcl.rgba.buf)
        rcommon_emit_vector( ctx,
                             &(rmesa->tcl.aos[nr]),
-                            (char *)VB->ColorPtr[0]->data,
+                            (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data,
                             emitsize,
-                            VB->ColorPtr[0]->stride,
+                            VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride,
                             count);
 
       nr++;
@@ -256,9 +256,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
 
        rcommon_emit_vector( ctx,
                             &(rmesa->tcl.aos[nr]),
-                            (char *)VB->SecondaryColorPtr[0]->data,
+                            (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data,
                             3,
-                            VB->SecondaryColorPtr[0]->stride,
+                            VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride,
                             count);
       }
 
index efb06db80e6b493df73f660850d68750a63c8c77..aa53e98fc866f99e716b2428a09b63dba3438ade 100644 (file)
@@ -122,9 +122,9 @@ static void TAG(emit)( GLcontext *ctx,
    }
 
    if (DO_RGBA) {
-      if (VB->ColorPtr[0]) {
-        col = VB->ColorPtr[0]->data;
-        col_stride = VB->ColorPtr[0]->stride;
+      if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]) {
+        col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+        col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
       } else {
         col = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
         col_stride = 0;
@@ -132,9 +132,9 @@ static void TAG(emit)( GLcontext *ctx,
    }
 
    if (DO_SPEC_OR_FOG) {
-      if (VB->SecondaryColorPtr[0]) {
-        spec = VB->SecondaryColorPtr[0]->data;
-        spec_stride = VB->SecondaryColorPtr[0]->stride;
+      if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
+        spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
+        spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
       } else {
         spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
         spec_stride = 0;
index 492880223284224ea4a4b00ea860b0bb21feb446..c200ba3255a2a4fcf131f2e29bded178d19a6486 100644 (file)
@@ -69,11 +69,11 @@ static void interp_extras( GLcontext *ctx,
 
    /*fprintf(stderr, "%s\n", __FUNCTION__);*/
 
-   if (VB->ColorPtr[1]) {
+   if (VB->BackfaceColorPtr) {
       INTERP_4F( t,
-                   GET_COLOR(VB->ColorPtr[1], dst),
-                   GET_COLOR(VB->ColorPtr[1], out),
-                   GET_COLOR(VB->ColorPtr[1], in) );
+                GET_COLOR(VB->BackfaceColorPtr, dst),
+                GET_COLOR(VB->BackfaceColorPtr, out),
+                GET_COLOR(VB->BackfaceColorPtr, in) );
    }
 
    if (VB->EdgeFlag) {
@@ -88,9 +88,9 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-        COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), 
-                    GET_COLOR(VB->ColorPtr[1], src) );
+   if (VB->BackfaceColorPtr) {
+      COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
+               GET_COLOR(VB->BackfaceColorPtr, src) );
    }
 
    setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src);
index 809d5d7dd9bb75f0fb50633f043d0a1921fa47b8..07e6e9a6a7adb2fbe37a59985bbbc177f5d3003a 100644 (file)
@@ -76,9 +76,9 @@ static void TAG(emit)( GLcontext *ctx,
    }
    
    if (IND & TDFX_RGBA_BIT) {
-      col = VB->ColorPtr[0]->data;
-      col_stride = VB->ColorPtr[0]->stride;
-      col_size = VB->ColorPtr[0]->size;
+      col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+      col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
+      col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
    }
    
    if (IND & TDFX_FOGC_BIT) {
index 1dc5f9891a1613c876e13bbf7a13fa96b9cd8ae4..cc9ad0e8b8349d5ff3537068bd09f4db6bf40146 100644 (file)
@@ -104,24 +104,24 @@ static void interp_extras( GLcontext *ctx,
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-      /* If stride is zero, ColorPtr[1] is constant across the VB, so
+   if (VB->BackfaceColorPtr) {
+      /* If stride is zero, BackfaceColorPtr is constant across the VB, so
        * there is no point interpolating between two values as they will
        * be identical.  This case is handled in t_dd_tritmp.h
        */
-      if (VB->ColorPtr[1]->stride) {
-        assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
+      if (VB->BackfaceColorPtr->stride) {
+        assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
         INTERP_4F( t,
-                   GET_COLOR(VB->ColorPtr[1], dst),
-                   GET_COLOR(VB->ColorPtr[1], out),
-                   GET_COLOR(VB->ColorPtr[1], in) );
+                   GET_COLOR(VB->BackfaceColorPtr, dst),
+                   GET_COLOR(VB->BackfaceColorPtr, out),
+                   GET_COLOR(VB->BackfaceColorPtr, in) );
       }
 
-      if (VB->SecondaryColorPtr[1]) {
+      if (VB->BackfaceSecondaryColorPtr) {
         INTERP_3F( t,
-                   GET_COLOR(VB->SecondaryColorPtr[1], dst),
-                   GET_COLOR(VB->SecondaryColorPtr[1], out),
-                   GET_COLOR(VB->SecondaryColorPtr[1], in) );
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
+                   GET_COLOR(VB->BackfaceSecondaryColorPtr, in) );
       }
    }
 
@@ -137,13 +137,13 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-        COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
-                  GET_COLOR(VB->ColorPtr[1], src) );
+   if (VB->BackfaceColorPtr) {
+        COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
+                  GET_COLOR(VB->BackfaceColorPtr, src) );
 
-        if (VB->SecondaryColorPtr[1]) {
-           COPY_3FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
-                     GET_COLOR(VB->SecondaryColorPtr[1], src) );
+        if (VB->BackfaceSecondaryColorPtr) {
+           COPY_3FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                     GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
         }
    }
 
index 674d9c6799d767c560f9b5a55fcfe3cf64c55fd7..742f5008639325a1f2c96eed03c786dd8e1eaee1 100644 (file)
@@ -80,14 +80,14 @@ static void TAG(emit)( GLcontext *ctx,
    }
    
    if (IND & SETUP_RGBA) {
-      col = VB->ColorPtr[0]->data;
-      col_stride = VB->ColorPtr[0]->stride;
-      col_size = VB->ColorPtr[0]->size;
+      col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+      col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
+      col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
    }
 
    if (IND & SETUP_SPEC) {
-      spec = VB->SecondaryColorPtr[0]->data;
-      spec_stride = VB->SecondaryColorPtr[0]->stride;
+      spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
+      spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
    }
 
    if (IND & SETUP_FOGC) {
index 46e652dc73bea0701d1a4974d53d194447af1fdb..0b373814feeacd63510273cde20b8ad233d83b23 100644 (file)
                GLfloat         ex,ey,fx,fy,cc;                                                 \
                /* Get vars for later */                                                        \
                VB              = &TNL_CONTEXT(ctx)->vb;                                        \
-               vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data;         \
-               if (VB->SecondaryColorPtr[1]) {                                         \
-                       vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
+               vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data;    \
+               if (VB->BackfaceSecondaryColorPtr) {                    \
+                       vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data;    \
                } else {                                                                                                        \
                        vbspec = NULL;                                                                                  \
                }                                                                                                                       \
        pV->Position.z  = p4f[##v][2];
 
 #define GLD_SETUP_SMOOTH_COLOUR_3D(v)                                                                                                                  \
-       p4f                     = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;                                                                          \
        pV->Diffuse     = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 
 #define GLD_SETUP_GET_FLAT_COLOUR_3D(v)                                                                                                        \
-       p4f             = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;  \
        dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 #define GLD_SETUP_USE_FLAT_COLOUR_3D                   \
index a85620dde8d2452a94d6467f2f443c49c385257e..c39775cad32897879ee8aba99ad4c8e9ebdcc29d 100644 (file)
@@ -151,7 +151,7 @@ static GLboolean gld_d3d_render_stage_run(
 #if 0
    // For debugging: Useful to see if an app passes colour data in
    // an unusual format.
-   switch (VB->ColorPtr[0]->Type) {
+   switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
    case GL_FLOAT:
           ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
           break;
index b95351553ca7404def8662e444847c37cea65d55..990922580aaf14726633ca28dcfd8a9f62e1578f 100644 (file)
                GLfloat         ex,ey,fx,fy,cc;                                                 \
                /* Get vars for later */                                                        \
                VB              = &TNL_CONTEXT(ctx)->vb;                                        \
-               vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data;         \
-               if (VB->SecondaryColorPtr[1]) {                                         \
-                       vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
+               vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data;    \
+               if (VB->BackfaceSecondaryColorPtr) {                    \
+                       vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data;    \
                } else {                                                                                                        \
                        vbspec = NULL;                                                                                  \
                }                                                                                                                       \
        pV->Position.z  = p4f[##v][2];
 
 #define GLD_SETUP_SMOOTH_COLOUR_3D(v)                                                                                                                  \
-       p4f                     = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;  \
        pV->Diffuse     = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 
 #define GLD_SETUP_GET_FLAT_COLOUR_3D(v)                                                                                                        \
-       p4f             = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;  \
        dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 #define GLD_SETUP_USE_FLAT_COLOUR_3D                   \
index cafbf4f5c50a089bc8dfcaf5f2679484d4b347e5..265c81fb4a48a0d6de07ee7e9d3c4bc9a49a3c1b 100644 (file)
@@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run(
 #if 0
    // For debugging: Useful to see if an app passes colour data in
    // an unusual format.
-   switch (VB->ColorPtr[0]->Type) {
+   switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
    case GL_FLOAT:
           ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
           break;
index 1b84cdee2855ad21103a8771b1a1eb3adb79f31b..fd4dd4ed75104f91962aeeb909605a1ffdf777d6 100644 (file)
                GLfloat         ex,ey,fx,fy,cc;                                                 \
                /* Get vars for later */                                                        \
                VB              = &TNL_CONTEXT(ctx)->vb;                                        \
-               vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data;         \
-               if (VB->SecondaryColorPtr[1]) {                                         \
-                       vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
+               vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data;    \
+               if (VB->BackfaceSecondaryColorPtr) {                    \
+                       vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data;    \
                } else {                                                                                                        \
                        vbspec = NULL;                                                                                  \
                }                                                                                                                       \
        pV->Position.z  = p4f[##v][2];
 
 #define GLD_SETUP_SMOOTH_COLOUR_3D(v)                                                                                                                  \
-       p4f                     = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;                                                                          \
        pV->Diffuse     = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 
 #define GLD_SETUP_GET_FLAT_COLOUR_3D(v)                                                                                                        \
-       p4f             = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR00]->data; \
        dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 #define GLD_SETUP_USE_FLAT_COLOUR_3D                   \
index 4fa6bcaf1abd1f9598ff271d969ffc78a750f5d4..91a68b3f2d9ce93ef71c231fec0303c8799ed65f 100644 (file)
@@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run(
 #if 0
    // For debugging: Useful to see if an app passes colour data in
    // an unusual format.
-   switch (VB->ColorPtr[0]->Type) {
+   switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
    case GL_FLOAT:
           ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
           break;
index 9700cf8c542bc9f05c9ed4e1b2cb7972b99a7c5d..17f38639563fc484d61933a701ce839a74f4899b 100644 (file)
@@ -67,8 +67,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
         if (facing == 1) {
            if (IND & SS_TWOSIDE_BIT) {
               if (IND & SS_RGBA_BIT) {
-                  if (VB->ColorPtr[1]) {
-                     GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
+                  if (VB->BackfaceColorPtr) {
+                     GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
 
                      if (swsetup->intColors) {
                         COPY_CHAN4(saved_color[0], v[0]->color);
@@ -81,7 +81,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                         COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]);
                      }
 
-                     if (VB->ColorPtr[1]->stride) {
+                     if (VB->BackfaceColorPtr->stride) {
                         if (swsetup->intColors) {
                            SS_COLOR(v[0]->color, vbcolor[e0]);
                            SS_COLOR(v[1]->color, vbcolor[e1]);
@@ -108,14 +108,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                      }
                   }
 
-                 if (VB->SecondaryColorPtr[1]) {
-                    GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
+                 if (VB->BackfaceSecondaryColorPtr) {
+                    GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
 
                     COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]);
                     COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]);
                     COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]);
 
-                    if (VB->SecondaryColorPtr[1]->stride) {
+                    if (VB->BackfaceSecondaryColorPtr->stride) {
                        SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]);
                        SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]);
                        SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]);
@@ -200,7 +200,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
    if (IND & SS_TWOSIDE_BIT) {
       if (facing == 1) {
         if (IND & SS_RGBA_BIT) {
-            if (VB->ColorPtr[1]) {
+            if (VB->BackfaceColorPtr) {
                if (swsetup->intColors) {
                   COPY_CHAN4(v[0]->color, saved_color[0]);
                   COPY_CHAN4(v[1]->color, saved_color[1]);
@@ -213,7 +213,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                }
             }
 
-           if (VB->SecondaryColorPtr[1]) {
+           if (VB->BackfaceSecondaryColorPtr) {
               COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]);
               COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]);
               COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]);
index b41cf93897aa8a544051e68fda6c6e05acfd3b6f..09ff8f8252150203b6aa16daf7fb4d7fd96e5619 100644 (file)
@@ -214,9 +214,9 @@ struct vertex_buffer
    GLubyte     *ClipMask;                      /* _TNL_BIT_POS */
    GLfloat     *NormalLengthPtr;               /* _TNL_BIT_NORMAL */
    GLboolean   *EdgeFlag;                      /* _TNL_BIT_EDGEFLAG */
-   GLvector4f  *BackfaceIndexPtr;               /* _TNL_BIT_INDEX */
-   GLvector4f  *ColorPtr[2];                   /* _TNL_BIT_COLOR0 */
-   GLvector4f  *SecondaryColorPtr[2];           /* _TNL_BIT_COLOR1 */
+   GLvector4f  *BackfaceIndexPtr;
+   GLvector4f  *BackfaceColorPtr;
+   GLvector4f  *BackfaceSecondaryColorPtr;
    GLvector4f  *FogCoordPtr;                   /* _TNL_BIT_FOG */
 
    const struct _mesa_prim  *Primitive;                      
index 80926276459f98f4afcad729099c498591e97cc8..0862fdfa85d7cd77a3c080cbaa816878050e0901 100644 (file)
@@ -254,11 +254,9 @@ static void bind_inputs( GLcontext *ctx,
 
    /* Legacy pointers -- remove one day.
     */
-   VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
-   VB->ColorPtr[1] = NULL;
+   VB->BackfaceColorPtr = NULL;
    VB->BackfaceIndexPtr = NULL;
-   VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
-   VB->SecondaryColorPtr[1] = NULL;
+   VB->BackfaceSecondaryColorPtr = NULL;
    VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
 
    /* Clipping and drawing code still requires this to be a packed
index e72a807f0dfe770647c1df30899e13a157bda451..8a0fe63fd8b75ab60feaa3042c883ae093aa79b8 100644 (file)
@@ -127,7 +127,7 @@ prepare_materials(GLcontext *ctx,
       const GLuint bitmask = ctx->Light.ColorMaterialBitmask;
       for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
         if (bitmask & (1<<i))
-           VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->ColorPtr[0];
+           VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
    }
 
    /* Now, for each material attribute that's tracking vertex color, save
@@ -246,9 +246,6 @@ static GLboolean run_lighting( GLcontext *ctx,
     */
    store->light_func_tab[idx]( ctx, VB, stage, input );
 
-   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0];
-   VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0];
-
    return GL_TRUE;
 }
 
index dd117e435cd07d1c4baad2446d460f15cea88057..4ebef2356f50e7ca459b9fff1423999778b5c553 100644 (file)
@@ -72,13 +72,13 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
    fprintf(stderr, "%s\n", __FUNCTION__ );
 #endif
 
-   VB->ColorPtr[0] = &store->LitColor[0];
-   VB->SecondaryColorPtr[0] = &store->LitSecondary[0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->LitSecondary[0];
    sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
 
 #if IDX & LIGHT_TWOSIDE
-   VB->ColorPtr[1] = &store->LitColor[1];
-   VB->SecondaryColorPtr[1] = &store->LitSecondary[1];
+   VB->BackfaceColorPtr = &store->LitColor[1];
+   VB->BackfaceSecondaryColorPtr = &store->LitSecondary[1];
    sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
 #endif
 
@@ -259,11 +259,11 @@ static void TAG(light_rgba)( GLcontext *ctx,
    fprintf(stderr, "%s\n", __FUNCTION__ );
 #endif
 
-   VB->ColorPtr[0] = &store->LitColor[0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
    sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
 
 #if IDX & LIGHT_TWOSIDE
-   VB->ColorPtr[1] = &store->LitColor[1];
+   VB->BackfaceColorPtr = &store->LitColor[1];
    sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
 #endif
 
@@ -449,9 +449,9 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
 
    (void) input;               /* doesn't refer to Eye or Obj */
 
-   VB->ColorPtr[0] = &store->LitColor[0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
 #if IDX & LIGHT_TWOSIDE
-   VB->ColorPtr[1] = &store->LitColor[1];
+   VB->BackfaceColorPtr = &store->LitColor[1];
 #endif
 
    if (nr > 1) {
@@ -559,9 +559,9 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
    sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
    sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
 
-   VB->ColorPtr[0] = &store->LitColor[0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
 #if IDX & LIGHT_TWOSIDE
-   VB->ColorPtr[1] = &store->LitColor[1];
+   VB->BackfaceColorPtr = &store->LitColor[1];
 #endif
 
    if (nr > 1) {
index d76b0a6b9da50a0c69550ab0690fae422039fce0..7002f74a0093af91e7de405ce5d93dc03176c6f4 100644 (file)
@@ -454,10 +454,10 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
       VB->ClipPtr->count = VB->Count;
    }
 
-   VB->ColorPtr[0] = &store->results[VERT_RESULT_COL0];
-   VB->ColorPtr[1] = &store->results[VERT_RESULT_BFC0];
-   VB->SecondaryColorPtr[0] = &store->results[VERT_RESULT_COL1];
-   VB->SecondaryColorPtr[1] = &store->results[VERT_RESULT_BFC1];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];
+   VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0];
+   VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1];
+   VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1];
    VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC];
 
    VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];
index f97ad7c2ed3870883897530ea5ab282b61ccdfff..fa34d11d7bdc3bd724265c1145257a48106dfc4a 100644 (file)
@@ -1092,27 +1092,27 @@ void _tnl_generic_interp_extras( GLcontext *ctx,
 {
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   /* If stride is zero, ColorPtr[1] is constant across the VB, so
+   /* If stride is zero, BackfaceColorPtr is constant across the VB, so
     * there is no point interpolating between two values as they will
     * be identical.  In all other cases, this value is generated by
     * t_vb_lighttmp.h and has a stride of 4 dwords.
     */
-   if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) {
-      assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
+   if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
+      assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
 
       INTERP_4F( t,
-                VB->ColorPtr[1]->data[dst],
-                VB->ColorPtr[1]->data[out],
-                VB->ColorPtr[1]->data[in] );
+                VB->BackfaceColorPtr->data[dst],
+                VB->BackfaceColorPtr->data[out],
+                VB->BackfaceColorPtr->data[in] );
    }
 
-   if (VB->SecondaryColorPtr[1]) {
-      assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat));
+   if (VB->BackfaceSecondaryColorPtr) {
+      assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));
       
       INTERP_3F( t,
-                VB->SecondaryColorPtr[1]->data[dst],
-                VB->SecondaryColorPtr[1]->data[out],
-                VB->SecondaryColorPtr[1]->data[in] );
+                VB->BackfaceSecondaryColorPtr->data[dst],
+                VB->BackfaceSecondaryColorPtr->data[out],
+                VB->BackfaceSecondaryColorPtr->data[in] );
    }
    
    if (VB->BackfaceIndexPtr) {
@@ -1135,14 +1135,14 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx,
 
    /* See above comment:
     */
-   if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) {
-      COPY_4FV( VB->ColorPtr[1]->data[dst], 
-               VB->ColorPtr[1]->data[src] );
+   if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
+      COPY_4FV( VB->BackfaceColorPtr->data[dst],
+               VB->BackfaceColorPtr->data[src] );
    }
 
-   if (VB->SecondaryColorPtr[1]) {
-      COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], 
-               VB->SecondaryColorPtr[1]->data[src] );
+   if (VB->BackfaceSecondaryColorPtr) {
+      COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst],
+               VB->BackfaceSecondaryColorPtr->data[src] );
    }
 
    if (VB->BackfaceIndexPtr) {
index e4b535fb680aecb576f52bec6567698e11ee3ede..e5885782c7a053a6c284a2b66af5554766165cf4 100644 (file)
@@ -443,7 +443,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
 
    } else if (HAVE_TRI_STRIPS && 
              ctx->Light.ShadeModel == GL_FLAT &&
-             TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) {
+             TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) {
       if (HAVE_ELTS) {
         LOCAL_VARS;
         int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -1221,7 +1221,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx,
            ok = GL_TRUE;
         } else if (HAVE_TRI_STRIPS && 
                    ctx->Light.ShadeModel == GL_FLAT &&
-                   VB->ColorPtr[0]->stride != 0) {
+                   VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0) {
            if (HAVE_ELTS) {
               ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS();
            }
index 0e3bc1329d75ec27409da9f02177f667c0e1f031..8574fe618b5ffcc218e984d4c10ae884e6f4f3ff 100644 (file)
@@ -195,7 +195,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                  }
               }
               else {
-                 GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
+                 GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
                  (void) vbcolor;
 
                  if (!DO_FLAT) {
@@ -204,8 +204,8 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                  }
                  VERT_SAVE_RGBA( 2 );
 
-                 if (VB->ColorPtr[1]->stride) {
-                    ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat));
+                 if (VB->BackfaceColorPtr->stride) {
+                    ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat));
 
                     if (!DO_FLAT) {              
                        VERT_SET_RGBA( v[0], vbcolor[e0] );
@@ -221,9 +221,9 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                     VERT_SET_RGBA( v[2], vbcolor[0] );
                  }
 
-                 if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
-                    GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
-                    ASSERT(VB->SecondaryColorPtr[1]->stride == 4*sizeof(GLfloat));
+                 if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
+                    GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
+                    ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat));
 
                     if (!DO_FLAT) {
                        VERT_SAVE_SPEC( 0 );
@@ -279,7 +279,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
         VERT_SAVE_RGBA( 1 );
         VERT_COPY_RGBA( v[0], v[2] );
         VERT_COPY_RGBA( v[1], v[2] );
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_SAVE_SPEC( 0 );
            VERT_SAVE_SPEC( 1 );
            VERT_COPY_SPEC( v[0], v[2] );
@@ -374,7 +374,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
       if (HAVE_RGBA) {
         VERT_RESTORE_RGBA( 0 );
         VERT_RESTORE_RGBA( 1 );
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_RESTORE_SPEC( 0 );
            VERT_RESTORE_SPEC( 1 );
         }
@@ -436,7 +436,7 @@ static void TAG(quadr)( GLcontext *ctx,
         if (DO_TWOSIDE && facing == 1)
         {
            if (HAVE_RGBA) {
-              GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
+              GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
               (void)vbcolor;
 
               if (HAVE_BACK_COLORS) {
@@ -471,7 +471,7 @@ static void TAG(quadr)( GLcontext *ctx,
                  }
                  VERT_SAVE_RGBA( 3 );
 
-                 if (VB->ColorPtr[1]->stride) {
+                 if (VB->BackfaceColorPtr->stride) {
                     if (!DO_FLAT) {
                        VERT_SET_RGBA( v[0], vbcolor[e0] );
                        VERT_SET_RGBA( v[1], vbcolor[e1] );
@@ -488,9 +488,9 @@ static void TAG(quadr)( GLcontext *ctx,
                     VERT_SET_RGBA( v[3], vbcolor[0] );
                  }
 
-                 if (HAVE_SPEC && VB->SecondaryColorPtr[1]) {
-                    GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
-                    ASSERT(VB->SecondaryColorPtr[1]->stride==4*sizeof(GLfloat));
+                 if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
+                    GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
+                    ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat));
 
                     if (!DO_FLAT) {
                        VERT_SAVE_SPEC( 0 );
@@ -553,7 +553,7 @@ static void TAG(quadr)( GLcontext *ctx,
         VERT_COPY_RGBA( v[0], v[3] );
         VERT_COPY_RGBA( v[1], v[3] );
         VERT_COPY_RGBA( v[2], v[3] );
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_SAVE_SPEC( 0 );
            VERT_SAVE_SPEC( 1 );
            VERT_SAVE_SPEC( 2 );
@@ -659,7 +659,7 @@ static void TAG(quadr)( GLcontext *ctx,
         VERT_RESTORE_RGBA( 0 );
         VERT_RESTORE_RGBA( 1 );
         VERT_RESTORE_RGBA( 2 );
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_RESTORE_SPEC( 0 );
            VERT_RESTORE_SPEC( 1 );
            VERT_RESTORE_SPEC( 2 );
@@ -708,7 +708,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
       if (HAVE_RGBA) {
         VERT_SAVE_RGBA( 0 );
         VERT_COPY_RGBA( v[0], v[1] );
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_SAVE_SPEC( 0 );
            VERT_COPY_SPEC( v[0], v[1] );
         }
@@ -725,7 +725,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
       if (HAVE_RGBA) {
         VERT_RESTORE_RGBA( 0 );
 
-        if (HAVE_SPEC && VB->SecondaryColorPtr[0]) {
+        if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
            VERT_RESTORE_SPEC( 0 );
         }
       }
index b3937c29a000596a0fcd960c2a4caad5bf704b6d..a8a0a69768d3b7a304002ac6b650704c0420b919 100644 (file)
@@ -297,19 +297,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
    LOCALVARS
    struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-      assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
+   if (VB->BackfaceColorPtr) {
+      assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
 
       INTERP_4F( t,
-                   GET_COLOR(VB->ColorPtr[1], dst),
-                   GET_COLOR(VB->ColorPtr[1], out),
-                   GET_COLOR(VB->ColorPtr[1], in) );
+                   GET_COLOR(VB->BackfaceColorPtr, dst),
+                   GET_COLOR(VB->BackfaceColorPtr, out),
+                   GET_COLOR(VB->BackfaceColorPtr, in) );
 
-      if (VB->SecondaryColorPtr[1]) {
+      if (VB->BackfaceSecondaryColorPtr) {
         INTERP_3F( t,
-                      GET_COLOR(VB->SecondaryColorPtr[1], dst),
-                      GET_COLOR(VB->SecondaryColorPtr[1], out),
-                      GET_COLOR(VB->SecondaryColorPtr[1], in) );
+                      GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                      GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
+                      GET_COLOR(VB->BackfaceSecondaryColorPtr, in) );
       }
    }
 
@@ -326,13 +326,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
    LOCALVARS
       struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
 
-   if (VB->ColorPtr[1]) {
-      COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), 
-               GET_COLOR(VB->ColorPtr[1], src) );
+   if (VB->BackfaceColorPtr) {
+      COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
+               GET_COLOR(VB->BackfaceColorPtr, src) );
 
-      if (VB->SecondaryColorPtr[1]) {
-        COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), 
-                  GET_COLOR(VB->SecondaryColorPtr[1], src) );
+      if (VB->BackfaceSecondaryColorPtr) {
+        COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
+                  GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
       }
    }
 
index c1cc6ae1bf05b14d3a1c429d85e696c1018745e0..a35218a158fc5f8b026781f29a236829ff063efc 100644 (file)
@@ -184,15 +184,15 @@ static void TAG(emit)( GLcontext *ctx,
    }
 
    if (DO_RGBA) {
-      col_stride = VB->ColorPtr[0]->stride;
-      col = VB->ColorPtr[0]->data;
-      col_size = VB->ColorPtr[0]->size;
+      col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
+      col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+      col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
    }
 
    if (DO_SPEC) {
-      if (VB->SecondaryColorPtr[0]) {
-        spec_stride = VB->SecondaryColorPtr[0]->stride;
-        spec = VB->SecondaryColorPtr[0]->data;
+      if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
+        spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
+        spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
       } else {
         spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
         spec_stride = 0;
@@ -356,9 +356,9 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
 
    ASSERT(stride == 4);
 
-   col = VB->ColorPtr[0]->data;
-   col_stride = VB->ColorPtr[0]->stride;
-   col_size = VB->ColorPtr[0]->size;
+   col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
+   col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
+   col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
 
 /*     fprintf(stderr, "%s(small) importable %x\n",  */
 /*        __FUNCTION__, VB->importable_data); */
index 5355c26874294563800bbb17adbf0a38dea73075..ce91b75f3a0eaff57730655a64feb6aa4a9b5577 100644 (file)
@@ -133,8 +133,8 @@ int main( int argc, char **argv )
    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, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] );
-   OFFSET( "VB_COLOR_PTR           ", struct vertex_buffer, ColorPtr );
-   OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr );
+   OFFSET( "VB_COLOR_PTR           ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR0] );
+   OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR1] );
    OFFSET( "VB_FOG_COORD_PTR       ", struct vertex_buffer, FogCoordPtr );
    OFFSET( "VB_PRIMITIVE           ", struct vertex_buffer, Primitive );
    printf( "\n" );