aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200/r200_state.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2006-10-24 22:37:51 +0000
committerRoland Scheidegger <[email protected]>2006-10-24 22:37:51 +0000
commitfc606f7db9072d4f40081aea8f92f1d4489a5115 (patch)
tree82b01e890ff3bd8ea96c7c92f688987b8e6b97ab /src/mesa/drivers/dri/r200/r200_state.c
parente4298b94927f12c4710443ede1b50a325103ac72 (diff)
fix (per-vertex) fog when using ARB_vp by incorporating fog factor computation into the vertex program (not yet fixed for swtnl). Simplify (and correct) the VTX_TCL_OUTPUT_VTXFMT handling when using vertex programs, turns out it's solely driven by the needs of the past-vertex stage of the pipeline, this should fix lockups with ill-specified applications using vertex programs (for instance applications enabling fog but not writing to fog coord output will now get (conformant) undefined results instead of lockups).
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_state.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index ff481a46e78..097fbc868a4 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -490,7 +490,7 @@ static void r200Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
GLuint fog = rmesa->hw.ctx.cmd[CTX_PP_FOG_COLOR];
fog &= ~R200_FOG_USE_MASK;
- if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
+ if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD || ctx->VertexProgram.Enabled) {
fog |= R200_FOG_USE_VTX_FOG;
out_0 |= R200_VTX_DISCRETE_FOG;
}
@@ -2219,10 +2219,9 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(R200_UCP_ENABLE_0 << i);
}*/
}
- /* FIXME: ugly as hell. need to call everything which might change tcl_output_vtxfmt0/1 and compsel */
+ /* ugly. Need to call everything which might change compsel. */
r200UpdateSpecular( ctx );
- r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL );
-#if 1
+#if 0
/* shouldn't be necessary, as it's picked up anyway in r200ValidateState (_NEW_PROGRAM),
but without it doom3 locks up at always the same places. Why? */
/* FIXME: This can (and should) be replaced by a call to the TCL_STATE_FLUSH reg before
@@ -2251,7 +2250,9 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
else {
/* picked up later */
}
+ /* call functions which change hw state based on ARB_vp enabled or not. */
r200PointParameter( ctx, GL_POINT_DISTANCE_ATTENUATION, NULL );
+ r200Fogfv( ctx, GL_FOG_COORD_SRC, NULL );
break;
case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: