tnl: Replace deprecated ColorPtr[] with AttribPtr or new BackfaceColorPtr.

This commit is contained in:
Eric Anholt
2009-11-18 01:38:55 -08:00
parent fc9a2970dc
commit 0a91878015
30 changed files with 189 additions and 194 deletions

View File

@@ -38,11 +38,11 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
#endif #endif
#if (IND & (FFB_VB_RGBA_BIT)) #if (IND & (FFB_VB_RGBA_BIT))
col0 = VB->ColorPtr[0]->data; col0 = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col0_stride = VB->ColorPtr[0]->stride; col0_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
#if (IND & (FFB_VB_TWOSIDE_BIT)) #if (IND & (FFB_VB_TWOSIDE_BIT))
col1 = VB->ColorPtr[1]->data; col1 = VB->BackfaceColorPtr->data;
col1_stride = VB->ColorPtr[1]->stride; col1_stride = VB->BackfaceColorPtr->stride;
#endif #endif
#endif #endif

View File

@@ -53,8 +53,8 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end)
GLfloat (*tc0)[4] = 0; GLfloat (*tc0)[4] = 0;
GLuint tc0_size = 0; GLuint tc0_size = 0;
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
if (ctx->Texture.Unit[0]._ReallyEnabled) { if (ctx->Texture.Unit[0]._ReallyEnabled) {
tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride; tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride;

View File

@@ -207,19 +207,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
LOCALVARS LOCALVARS
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_4F( t, INTERP_4F( t,
GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->BackfaceColorPtr, out),
GET_COLOR(VB->ColorPtr[1], in) ); GET_COLOR(VB->BackfaceColorPtr, in) );
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
INTERP_3F( t, INTERP_3F( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
GET_COLOR(VB->SecondaryColorPtr[1], in) ); GET_COLOR(VB->BackfaceSecondaryColorPtr, in) );
} }
} }
@@ -236,13 +236,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
LOCALVARS LOCALVARS
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], src) ); GET_COLOR(VB->BackfaceColorPtr, src) );
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) ); GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
} }
} }

View File

@@ -123,9 +123,9 @@ static void TAG(emit)( GLcontext *ctx,
#endif #endif
#if DO_SPEC #if DO_SPEC
if (VB->SecondaryColorPtr[0]) { if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
spec = VB->SecondaryColorPtr[0]->data; spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride; spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
} else { } else {
spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
spec_stride = 0; spec_stride = 0;
@@ -144,8 +144,8 @@ static void TAG(emit)( GLcontext *ctx,
#endif #endif
#if DO_RGBA #if DO_RGBA
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
#endif #endif
coord = VB->NdcPtr->data; coord = VB->NdcPtr->data;

View File

@@ -187,13 +187,13 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (DO_RGBA) { if (DO_RGBA) {
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
} }
if (DO_SPEC) { if (DO_SPEC) {
spec = VB->SecondaryColorPtr[0]->data; spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride; spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
} else { } else {
spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
spec_stride = 0; spec_stride = 0;
@@ -384,8 +384,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
ASSERT(stride == 4); ASSERT(stride == 4);
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
/* Pack what's left into a 4-dword vertex. Color is in a different /* Pack what's left into a 4-dword vertex. Color is in a different
* place, and there is no 'w' coordinate. * 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; GLfloat *v = (GLfloat *)dest;
int i; int i;
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
if (start) if (start)
STRIDE_4F(col, col_stride * start); STRIDE_4F(col, col_stride * start);

View File

@@ -124,7 +124,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_
} }
if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) { 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; OutputsWritten |= 1 << VERT_RESULT_BFC0;
#if MESA_LITTLE_ENDIAN #if MESA_LITTLE_ENDIAN
EMIT_ATTR( _TNL_ATTRIB_GENERIC0, EMIT_4UB_4F_RGBA ); 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); ADD_ATTR(VERT_ATTRIB_GENERIC0, R300_DATA_TYPE_BYTE, SWTCL_OVM_COLOR2, SWIZZLE_XYZW, MASK_XYZW, 1);
#endif #endif
if (fp_reads & FRAG_BIT_COL1) { 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); GLuint swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE);
OutputsWritten |= 1 << VERT_RESULT_BFC1; OutputsWritten |= 1 << VERT_RESULT_BFC1;
#if MESA_LITTLE_ENDIAN #if MESA_LITTLE_ENDIAN

View File

@@ -227,9 +227,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
if (inputs & VERT_BIT_COLOR0) { if (inputs & VERT_BIT_COLOR0) {
int emitsize; int emitsize;
if (VB->ColorPtr[0]->size == 4 && if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size == 4 &&
(VB->ColorPtr[0]->stride != 0 || (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0 ||
VB->ColorPtr[0]->data[0][3] != 1.0)) { VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data[0][3] != 1.0)) {
vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA; vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA;
emitsize = 4; emitsize = 4;
} }
@@ -242,9 +242,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
if (!rmesa->tcl.rgba.buf) if (!rmesa->tcl.rgba.buf)
rcommon_emit_vector( ctx, rcommon_emit_vector( ctx,
&(rmesa->tcl.aos[nr]), &(rmesa->tcl.aos[nr]),
(char *)VB->ColorPtr[0]->data, (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data,
emitsize, emitsize,
VB->ColorPtr[0]->stride, VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride,
count); count);
nr++; nr++;
@@ -256,9 +256,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
rcommon_emit_vector( ctx, rcommon_emit_vector( ctx,
&(rmesa->tcl.aos[nr]), &(rmesa->tcl.aos[nr]),
(char *)VB->SecondaryColorPtr[0]->data, (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data,
3, 3,
VB->SecondaryColorPtr[0]->stride, VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride,
count); count);
} }

View File

@@ -122,9 +122,9 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (DO_RGBA) { if (DO_RGBA) {
if (VB->ColorPtr[0]) { if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]) {
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
} else { } else {
col = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; col = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
col_stride = 0; col_stride = 0;
@@ -132,9 +132,9 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (DO_SPEC_OR_FOG) { if (DO_SPEC_OR_FOG) {
if (VB->SecondaryColorPtr[0]) { if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
spec = VB->SecondaryColorPtr[0]->data; spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride; spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
} else { } else {
spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
spec_stride = 0; spec_stride = 0;

View File

@@ -69,11 +69,11 @@ static void interp_extras( GLcontext *ctx,
/*fprintf(stderr, "%s\n", __FUNCTION__);*/ /*fprintf(stderr, "%s\n", __FUNCTION__);*/
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
INTERP_4F( t, INTERP_4F( t,
GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->BackfaceColorPtr, out),
GET_COLOR(VB->ColorPtr[1], in) ); GET_COLOR(VB->BackfaceColorPtr, in) );
} }
if (VB->EdgeFlag) { 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; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], src) ); GET_COLOR(VB->BackfaceColorPtr, src) );
} }
setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src); setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src);

View File

@@ -76,9 +76,9 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (IND & TDFX_RGBA_BIT) { if (IND & TDFX_RGBA_BIT) {
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
col_size = VB->ColorPtr[0]->size; col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
} }
if (IND & TDFX_FOGC_BIT) { if (IND & TDFX_FOGC_BIT) {

View File

@@ -104,24 +104,24 @@ static void interp_extras( GLcontext *ctx,
{ {
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
/* 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 * there is no point interpolating between two values as they will
* be identical. This case is handled in t_dd_tritmp.h * be identical. This case is handled in t_dd_tritmp.h
*/ */
if (VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr->stride) {
assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_4F( t, INTERP_4F( t,
GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->BackfaceColorPtr, out),
GET_COLOR(VB->ColorPtr[1], in) ); GET_COLOR(VB->BackfaceColorPtr, in) );
} }
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
INTERP_3F( t, INTERP_3F( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
GET_COLOR(VB->SecondaryColorPtr[1], in) ); 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; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], src) ); GET_COLOR(VB->BackfaceColorPtr, src) );
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
COPY_3FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), COPY_3FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) ); GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
} }
} }

View File

@@ -80,14 +80,14 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (IND & SETUP_RGBA) { if (IND & SETUP_RGBA) {
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
col_size = VB->ColorPtr[0]->size; col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
} }
if (IND & SETUP_SPEC) { if (IND & SETUP_SPEC) {
spec = VB->SecondaryColorPtr[0]->data; spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride; spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
} }
if (IND & SETUP_FOGC) { if (IND & SETUP_FOGC) {

View File

@@ -189,9 +189,9 @@
GLfloat ex,ey,fx,fy,cc; \ GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \ /* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \ VB = &TNL_CONTEXT(ctx)->vb; \
vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \
if (VB->SecondaryColorPtr[1]) { \ if (VB->BackfaceSecondaryColorPtr) { \
vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \
} else { \ } else { \
vbspec = NULL; \ vbspec = NULL; \
} \ } \
@@ -247,12 +247,12 @@
pV->Position.z = p4f[##v][2]; pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ #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]); pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ #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]); dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \ #define GLD_SETUP_USE_FLAT_COLOUR_3D \

View File

@@ -151,7 +151,7 @@ static GLboolean gld_d3d_render_stage_run(
#if 0 #if 0
// For debugging: Useful to see if an app passes colour data in // For debugging: Useful to see if an app passes colour data in
// an unusual format. // an unusual format.
switch (VB->ColorPtr[0]->Type) { switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT: case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break; break;

View File

@@ -189,9 +189,9 @@
GLfloat ex,ey,fx,fy,cc; \ GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \ /* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \ VB = &TNL_CONTEXT(ctx)->vb; \
vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \
if (VB->SecondaryColorPtr[1]) { \ if (VB->BackfaceSecondaryColorPtr) { \
vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \
} else { \ } else { \
vbspec = NULL; \ vbspec = NULL; \
} \ } \
@@ -247,12 +247,12 @@
pV->Position.z = p4f[##v][2]; pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ #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]); pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ #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]); dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \ #define GLD_SETUP_USE_FLAT_COLOUR_3D \

View File

@@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run(
#if 0 #if 0
// For debugging: Useful to see if an app passes colour data in // For debugging: Useful to see if an app passes colour data in
// an unusual format. // an unusual format.
switch (VB->ColorPtr[0]->Type) { switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT: case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break; break;

View File

@@ -189,9 +189,9 @@
GLfloat ex,ey,fx,fy,cc; \ GLfloat ex,ey,fx,fy,cc; \
/* Get vars for later */ \ /* Get vars for later */ \
VB = &TNL_CONTEXT(ctx)->vb; \ VB = &TNL_CONTEXT(ctx)->vb; \
vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \
if (VB->SecondaryColorPtr[1]) { \ if (VB->BackfaceSecondaryColorPtr) { \
vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \
} else { \ } else { \
vbspec = NULL; \ vbspec = NULL; \
} \ } \
@@ -247,12 +247,12 @@
pV->Position.z = p4f[##v][2]; pV->Position.z = p4f[##v][2];
#define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ #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]); pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ #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]); dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
#define GLD_SETUP_USE_FLAT_COLOUR_3D \ #define GLD_SETUP_USE_FLAT_COLOUR_3D \

View File

@@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run(
#if 0 #if 0
// For debugging: Useful to see if an app passes colour data in // For debugging: Useful to see if an app passes colour data in
// an unusual format. // an unusual format.
switch (VB->ColorPtr[0]->Type) { switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) {
case GL_FLOAT: case GL_FLOAT:
ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n");
break; break;

View File

@@ -67,8 +67,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
if (facing == 1) { if (facing == 1) {
if (IND & SS_TWOSIDE_BIT) { if (IND & SS_TWOSIDE_BIT) {
if (IND & SS_RGBA_BIT) { if (IND & SS_RGBA_BIT) {
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
if (swsetup->intColors) { if (swsetup->intColors) {
COPY_CHAN4(saved_color[0], v[0]->color); 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]); COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]);
} }
if (VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr->stride) {
if (swsetup->intColors) { if (swsetup->intColors) {
SS_COLOR(v[0]->color, vbcolor[e0]); SS_COLOR(v[0]->color, vbcolor[e0]);
SS_COLOR(v[1]->color, vbcolor[e1]); 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]) { if (VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); 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[1], v[1]->attrib[FRAG_ATTRIB_COL1]);
COPY_4V(saved_spec[2], v[2]->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[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]);
SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]);
SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); 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 (IND & SS_TWOSIDE_BIT) {
if (facing == 1) { if (facing == 1) {
if (IND & SS_RGBA_BIT) { if (IND & SS_RGBA_BIT) {
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
if (swsetup->intColors) { if (swsetup->intColors) {
COPY_CHAN4(v[0]->color, saved_color[0]); COPY_CHAN4(v[0]->color, saved_color[0]);
COPY_CHAN4(v[1]->color, saved_color[1]); 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[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]);

View File

@@ -214,9 +214,9 @@ struct vertex_buffer
GLubyte *ClipMask; /* _TNL_BIT_POS */ GLubyte *ClipMask; /* _TNL_BIT_POS */
GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */
GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */
GLvector4f *BackfaceIndexPtr; /* _TNL_BIT_INDEX */ GLvector4f *BackfaceIndexPtr;
GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ GLvector4f *BackfaceColorPtr;
GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ GLvector4f *BackfaceSecondaryColorPtr;
GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */
const struct _mesa_prim *Primitive; const struct _mesa_prim *Primitive;

View File

@@ -254,11 +254,9 @@ static void bind_inputs( GLcontext *ctx,
/* Legacy pointers -- remove one day. /* Legacy pointers -- remove one day.
*/ */
VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->BackfaceColorPtr = NULL;
VB->ColorPtr[1] = NULL;
VB->BackfaceIndexPtr = NULL; VB->BackfaceIndexPtr = NULL;
VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1]; VB->BackfaceSecondaryColorPtr = NULL;
VB->SecondaryColorPtr[1] = NULL;
VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
/* Clipping and drawing code still requires this to be a packed /* Clipping and drawing code still requires this to be a packed

View File

@@ -127,7 +127,7 @@ prepare_materials(GLcontext *ctx,
const GLuint bitmask = ctx->Light.ColorMaterialBitmask; const GLuint bitmask = ctx->Light.ColorMaterialBitmask;
for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
if (bitmask & (1<<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 /* 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 ); 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; return GL_TRUE;
} }

View File

@@ -72,13 +72,13 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
fprintf(stderr, "%s\n", __FUNCTION__ ); fprintf(stderr, "%s\n", __FUNCTION__ );
#endif #endif
VB->ColorPtr[0] = &store->LitColor[0]; VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0];
VB->SecondaryColorPtr[0] = &store->LitSecondary[0]; VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->LitSecondary[0];
sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
#if IDX & LIGHT_TWOSIDE #if IDX & LIGHT_TWOSIDE
VB->ColorPtr[1] = &store->LitColor[1]; VB->BackfaceColorPtr = &store->LitColor[1];
VB->SecondaryColorPtr[1] = &store->LitSecondary[1]; VB->BackfaceSecondaryColorPtr = &store->LitSecondary[1];
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
#endif #endif
@@ -259,11 +259,11 @@ static void TAG(light_rgba)( GLcontext *ctx,
fprintf(stderr, "%s\n", __FUNCTION__ ); fprintf(stderr, "%s\n", __FUNCTION__ );
#endif #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]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
#if IDX & LIGHT_TWOSIDE #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]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3];
#endif #endif
@@ -449,9 +449,9 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
(void) input; /* doesn't refer to Eye or Obj */ (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 #if IDX & LIGHT_TWOSIDE
VB->ColorPtr[1] = &store->LitColor[1]; VB->BackfaceColorPtr = &store->LitColor[1];
#endif #endif
if (nr > 1) { 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[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3];
sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_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 #if IDX & LIGHT_TWOSIDE
VB->ColorPtr[1] = &store->LitColor[1]; VB->BackfaceColorPtr = &store->LitColor[1];
#endif #endif
if (nr > 1) { if (nr > 1) {

View File

@@ -454,10 +454,10 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
VB->ClipPtr->count = VB->Count; VB->ClipPtr->count = VB->Count;
} }
VB->ColorPtr[0] = &store->results[VERT_RESULT_COL0]; VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];
VB->ColorPtr[1] = &store->results[VERT_RESULT_BFC0]; VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0];
VB->SecondaryColorPtr[0] = &store->results[VERT_RESULT_COL1]; VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1];
VB->SecondaryColorPtr[1] = &store->results[VERT_RESULT_BFC1]; VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1];
VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC]; VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC];
VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];

View File

@@ -1092,27 +1092,27 @@ void _tnl_generic_interp_extras( GLcontext *ctx,
{ {
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; 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 * there is no point interpolating between two values as they will
* be identical. In all other cases, this value is generated by * be identical. In all other cases, this value is generated by
* t_vb_lighttmp.h and has a stride of 4 dwords. * t_vb_lighttmp.h and has a stride of 4 dwords.
*/ */
if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_4F( t, INTERP_4F( t,
VB->ColorPtr[1]->data[dst], VB->BackfaceColorPtr->data[dst],
VB->ColorPtr[1]->data[out], VB->BackfaceColorPtr->data[out],
VB->ColorPtr[1]->data[in] ); VB->BackfaceColorPtr->data[in] );
} }
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat)); assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_3F( t, INTERP_3F( t,
VB->SecondaryColorPtr[1]->data[dst], VB->BackfaceSecondaryColorPtr->data[dst],
VB->SecondaryColorPtr[1]->data[out], VB->BackfaceSecondaryColorPtr->data[out],
VB->SecondaryColorPtr[1]->data[in] ); VB->BackfaceSecondaryColorPtr->data[in] );
} }
if (VB->BackfaceIndexPtr) { if (VB->BackfaceIndexPtr) {
@@ -1135,14 +1135,14 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx,
/* See above comment: /* See above comment:
*/ */
if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
COPY_4FV( VB->ColorPtr[1]->data[dst], COPY_4FV( VB->BackfaceColorPtr->data[dst],
VB->ColorPtr[1]->data[src] ); VB->BackfaceColorPtr->data[src] );
} }
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst],
VB->SecondaryColorPtr[1]->data[src] ); VB->BackfaceSecondaryColorPtr->data[src] );
} }
if (VB->BackfaceIndexPtr) { if (VB->BackfaceIndexPtr) {

View File

@@ -443,7 +443,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
} else if (HAVE_TRI_STRIPS && } else if (HAVE_TRI_STRIPS &&
ctx->Light.ShadeModel == GL_FLAT && ctx->Light.ShadeModel == GL_FLAT &&
TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) { TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) {
if (HAVE_ELTS) { if (HAVE_ELTS) {
LOCAL_VARS; LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -1221,7 +1221,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx,
ok = GL_TRUE; ok = GL_TRUE;
} else if (HAVE_TRI_STRIPS && } else if (HAVE_TRI_STRIPS &&
ctx->Light.ShadeModel == GL_FLAT && ctx->Light.ShadeModel == GL_FLAT &&
VB->ColorPtr[0]->stride != 0) { VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0) {
if (HAVE_ELTS) { if (HAVE_ELTS) {
ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS(); ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS();
} }

View File

@@ -195,7 +195,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
} }
} }
else { else {
GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
(void) vbcolor; (void) vbcolor;
if (!DO_FLAT) { if (!DO_FLAT) {
@@ -204,8 +204,8 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
} }
VERT_SAVE_RGBA( 2 ); VERT_SAVE_RGBA( 2 );
if (VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr->stride) {
ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat)); ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat));
if (!DO_FLAT) { if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] ); 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] ); VERT_SET_RGBA( v[2], vbcolor[0] );
} }
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
ASSERT(VB->SecondaryColorPtr[1]->stride == 4*sizeof(GLfloat)); ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat));
if (!DO_FLAT) { if (!DO_FLAT) {
VERT_SAVE_SPEC( 0 ); 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_SAVE_RGBA( 1 );
VERT_COPY_RGBA( v[0], v[2] ); VERT_COPY_RGBA( v[0], v[2] );
VERT_COPY_RGBA( v[1], 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( 0 );
VERT_SAVE_SPEC( 1 ); VERT_SAVE_SPEC( 1 );
VERT_COPY_SPEC( v[0], v[2] ); 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) { if (HAVE_RGBA) {
VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 0 );
VERT_RESTORE_RGBA( 1 ); 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( 0 );
VERT_RESTORE_SPEC( 1 ); VERT_RESTORE_SPEC( 1 );
} }
@@ -436,7 +436,7 @@ static void TAG(quadr)( GLcontext *ctx,
if (DO_TWOSIDE && facing == 1) if (DO_TWOSIDE && facing == 1)
{ {
if (HAVE_RGBA) { if (HAVE_RGBA) {
GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
(void)vbcolor; (void)vbcolor;
if (HAVE_BACK_COLORS) { if (HAVE_BACK_COLORS) {
@@ -471,7 +471,7 @@ static void TAG(quadr)( GLcontext *ctx,
} }
VERT_SAVE_RGBA( 3 ); VERT_SAVE_RGBA( 3 );
if (VB->ColorPtr[1]->stride) { if (VB->BackfaceColorPtr->stride) {
if (!DO_FLAT) { if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] ); VERT_SET_RGBA( v[0], vbcolor[e0] );
VERT_SET_RGBA( v[1], vbcolor[e1] ); VERT_SET_RGBA( v[1], vbcolor[e1] );
@@ -488,9 +488,9 @@ static void TAG(quadr)( GLcontext *ctx,
VERT_SET_RGBA( v[3], vbcolor[0] ); VERT_SET_RGBA( v[3], vbcolor[0] );
} }
if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
ASSERT(VB->SecondaryColorPtr[1]->stride==4*sizeof(GLfloat)); ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat));
if (!DO_FLAT) { if (!DO_FLAT) {
VERT_SAVE_SPEC( 0 ); 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[0], v[3] );
VERT_COPY_RGBA( v[1], v[3] ); VERT_COPY_RGBA( v[1], v[3] );
VERT_COPY_RGBA( v[2], 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( 0 );
VERT_SAVE_SPEC( 1 ); VERT_SAVE_SPEC( 1 );
VERT_SAVE_SPEC( 2 ); VERT_SAVE_SPEC( 2 );
@@ -659,7 +659,7 @@ static void TAG(quadr)( GLcontext *ctx,
VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 0 );
VERT_RESTORE_RGBA( 1 ); VERT_RESTORE_RGBA( 1 );
VERT_RESTORE_RGBA( 2 ); 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( 0 );
VERT_RESTORE_SPEC( 1 ); VERT_RESTORE_SPEC( 1 );
VERT_RESTORE_SPEC( 2 ); VERT_RESTORE_SPEC( 2 );
@@ -708,7 +708,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
if (HAVE_RGBA) { if (HAVE_RGBA) {
VERT_SAVE_RGBA( 0 ); VERT_SAVE_RGBA( 0 );
VERT_COPY_RGBA( v[0], v[1] ); 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_SAVE_SPEC( 0 );
VERT_COPY_SPEC( v[0], v[1] ); VERT_COPY_SPEC( v[0], v[1] );
} }
@@ -725,7 +725,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 )
if (HAVE_RGBA) { if (HAVE_RGBA) {
VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 0 );
if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
VERT_RESTORE_SPEC( 0 ); VERT_RESTORE_SPEC( 0 );
} }
} }

View File

@@ -297,19 +297,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
LOCALVARS LOCALVARS
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
INTERP_4F( t, INTERP_4F( t,
GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->BackfaceColorPtr, out),
GET_COLOR(VB->ColorPtr[1], in) ); GET_COLOR(VB->BackfaceColorPtr, in) );
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
INTERP_3F( t, INTERP_3F( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->BackfaceSecondaryColorPtr, out),
GET_COLOR(VB->SecondaryColorPtr[1], in) ); GET_COLOR(VB->BackfaceSecondaryColorPtr, in) );
} }
} }
@@ -326,13 +326,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
LOCALVARS LOCALVARS
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) { if (VB->BackfaceColorPtr) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst),
GET_COLOR(VB->ColorPtr[1], src) ); GET_COLOR(VB->BackfaceColorPtr, src) );
if (VB->SecondaryColorPtr[1]) { if (VB->BackfaceSecondaryColorPtr) {
COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) ); GET_COLOR(VB->BackfaceSecondaryColorPtr, src) );
} }
} }

View File

@@ -184,15 +184,15 @@ static void TAG(emit)( GLcontext *ctx,
} }
if (DO_RGBA) { if (DO_RGBA) {
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_size = VB->ColorPtr[0]->size; col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
} }
if (DO_SPEC) { if (DO_SPEC) {
if (VB->SecondaryColorPtr[0]) { if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) {
spec_stride = VB->SecondaryColorPtr[0]->stride; spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride;
spec = VB->SecondaryColorPtr[0]->data; spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data;
} else { } else {
spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
spec_stride = 0; spec_stride = 0;
@@ -356,9 +356,9 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
ASSERT(stride == 4); ASSERT(stride == 4);
col = VB->ColorPtr[0]->data; col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;
col_stride = VB->ColorPtr[0]->stride; col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride;
col_size = VB->ColorPtr[0]->size; col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size;
/* fprintf(stderr, "%s(small) importable %x\n", */ /* fprintf(stderr, "%s(small) importable %x\n", */
/* __FUNCTION__, VB->importable_data); */ /* __FUNCTION__, VB->importable_data); */

View 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_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] );
OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] ); 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_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] );
OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR0] );
OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR1] );
OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr );
OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive ); OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive );
printf( "\n" ); printf( "\n" );