summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-11-18 01:38:55 -0800
committerEric Anholt <eric@anholt.net>2009-11-19 11:47:05 +0100
commit0a9187801505130738ae947c69cafa8a1dd118d1 (patch)
treeff0c2c6da3efff67337a7f855f68a700ef8148de /src/mesa/tnl
parentfc9a2970dc539b21b035ea0a770ec69822962145 (diff)
tnl: Replace deprecated ColorPtr[] with AttribPtr or new BackfaceColorPtr.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_context.h6
-rw-r--r--src/mesa/tnl/t_draw.c6
-rw-r--r--src/mesa/tnl/t_vb_light.c5
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h20
-rw-r--r--src/mesa/tnl/t_vb_program.c8
-rw-r--r--src/mesa/tnl/t_vertex_generic.c34
6 files changed, 37 insertions, 42 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index b41cf93897..09ff8f8252 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -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;
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 8092627645..0862fdfa85 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -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
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index e72a807f0d..8a0fe63fd8 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -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;
}
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index dd117e435c..4ebef2356f 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -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) {
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index d76b0a6b9d..7002f74a00 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -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];
diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c
index f97ad7c2ed..fa34d11d7b 100644
--- a/src/mesa/tnl/t_vertex_generic.c
+++ b/src/mesa/tnl/t_vertex_generic.c
@@ -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) {