summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
index 265d061b36..034cda8a65 100644
--- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
+++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
@@ -50,7 +50,6 @@ static void TAG(emit)( GLcontext *ctx,
GLuint rqcoordsnoswap = 0;
GLuint (*coord)[4];
GLuint coord_stride; /* object coordinates */
- GLubyte dummy[4];
int i;
union emit_union *v = (union emit_union *)dest;
@@ -133,7 +132,7 @@ static void TAG(emit)( GLcontext *ctx,
}
}
- if (DO_SPEC) {
+ if (DO_SPEC_OR_FOG) {
if (VB->SecondaryColorPtr[0]) {
spec = VB->SecondaryColorPtr[0]->data;
spec_stride = VB->SecondaryColorPtr[0]->stride;
@@ -143,12 +142,12 @@ static void TAG(emit)( GLcontext *ctx,
}
}
- if (DO_FOG) {
+ if (DO_SPEC_OR_FOG) {
if (VB->FogCoordPtr) {
fog = VB->FogCoordPtr->data;
fog_stride = VB->FogCoordPtr->stride;
} else {
- fog = (GLfloat (*)[4])&dummy; fog[0][0] = 0.0F;
+ fog = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_FOG];
fog_stride = 0;
}
}
@@ -202,7 +201,7 @@ static void TAG(emit)( GLcontext *ctx,
STRIDE_4F(col, col_stride);
v++;
}
- if (DO_SPEC || DO_FOG) {
+ if (DO_SPEC_OR_FOG) {
if (DO_SPEC) {
UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.red, spec[0][0]);
UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.green, spec[0][1]);
@@ -210,8 +209,8 @@ static void TAG(emit)( GLcontext *ctx,
STRIDE_4F(spec, spec_stride);
}
if (DO_FOG) {
- UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.alpha, fog[0][0]);
- fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0].rgba.alpha, radeonComputeFogBlendFactor(ctx, fog[0][0]));
+ STRIDE_4F(fog, fog_stride);
}
if (TCL_DEBUG) fprintf(stderr, "%x ", v[0].ui);
v++;
@@ -283,7 +282,7 @@ static void TAG(init)( void )
if (DO_W) sz++;
if (DO_NORM) sz += 3;
if (DO_RGBA) sz++;
- if (DO_SPEC || DO_FOG) sz++;
+ if (DO_SPEC_OR_FOG) sz++;
if (DO_TEX0) sz += 2;
if (DO_TEX0 && DO_PTEX) sz++;
if (DO_TEX1) sz += 2;