summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_maos_arrays.c
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2006-10-24 22:37:51 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2006-10-24 22:37:51 +0000
commitfc606f7db9072d4f40081aea8f92f1d4489a5115 (patch)
tree82b01e890ff3bd8ea96c7c92f688987b8e6b97ab /src/mesa/drivers/dri/r200/r200_maos_arrays.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_maos_arrays.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 12ea462a40..92348c90ca 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -420,12 +420,21 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
}
if (inputs & VERT_BIT_FOG) {
- if (!rmesa->tcl.fog.buf)
- emit_vecfog( ctx,
- &(rmesa->tcl.fog),
- (char *)VB->FogCoordPtr->data,
- VB->FogCoordPtr->stride,
- count);
+ if (!rmesa->tcl.fog.buf) {
+ if (ctx->VertexProgram._Enabled)
+ emit_vector( ctx,
+ &(rmesa->tcl.fog),
+ (char *)VB->FogCoordPtr->data,
+ 1,
+ VB->FogCoordPtr->stride,
+ count);
+ else
+ emit_vecfog( ctx,
+ &(rmesa->tcl.fog),
+ (char *)VB->FogCoordPtr->data,
+ VB->FogCoordPtr->stride,
+ count);
+ }
vfmt0 |= R200_VTX_DISCRETE_FOG;
component[nr++] = &rmesa->tcl.fog;