summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2005-10-17 00:54:12 +0000
committerRoland Scheidegger <[email protected]>2005-10-17 00:54:12 +0000
commit2d61d301171620efe624d83a5457f4094eb49cba (patch)
treefc53f97e4e2cba24bdf654fc2aba72975c18ccaf /src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
parentdd5a86339f8b10f72c8a0e15c14463af3e0f717d (diff)
add GL_EXT_fog_coord support to radeon driver. No vtxfmt code (just uses fallback) yet. May cause a tcl fallback if fog coord is used together with separate specular lighting. Fog factors are precomputed and then submitted instead of the raw coords (chip limitation, same as on r200).
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_vtxfmt.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_vtxfmt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c b/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
index e554aeb3300..c734ab8d5ab 100644
--- a/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
+++ b/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c
@@ -549,7 +549,8 @@ static GLboolean check_vtx_fmt( GLcontext *ctx )
GLuint ind = RADEON_CP_VC_FRMT_Z;
GLuint unit;
- if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag)
+ if (rmesa->TclFallback || rmesa->vb.fell_back || ctx->CompileFlag ||
+ (ctx->Fog.Enabled && (ctx->Fog.FogCoordinateSource == GL_FOG_COORD)))
return GL_FALSE;
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
@@ -582,6 +583,10 @@ static GLboolean check_vtx_fmt( GLcontext *ctx )
}
}
+ if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
+ ind |= RADEON_CP_VC_FRMT_PKSPEC;
+ }
+
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
if (ctx->Texture.Unit[unit].TexGenEnabled) {
@@ -657,6 +662,9 @@ static GLboolean check_vtx_fmt( GLcontext *ctx )
UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->red, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0] );
UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->green, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1] );
UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->blue, ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2] );
+ /* fog ??? */
+/* UNCLAMPED_FLOAT_TO_CHAN( rmesa->vb.specptr->alpha,
+ radeonComputeFogFactor(ctx->Current.Attrib[VERT_ATTRIB_FOG][0]) ); */
}
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
@@ -948,8 +956,6 @@ void radeonVtxfmtInit( GLcontext *ctx, GLboolean useCodegen )
/* Not active in supported states; just keep ctx->Current uptodate:
*/
- vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
- vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
vfmt->Indexf = _mesa_noop_Indexf;
@@ -986,6 +992,8 @@ void radeonVtxfmtInit( GLcontext *ctx, GLboolean useCodegen )
vfmt->VertexAttrib3fvNV = radeon_fallback_VertexAttrib3fvNV;
vfmt->VertexAttrib4fNV = radeon_fallback_VertexAttrib4fNV;
vfmt->VertexAttrib4fvNV = radeon_fallback_VertexAttrib4fvNV;
+ vfmt->FogCoordfEXT = radeon_fallback_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = radeon_fallback_FogCoordfvEXT;
(void)radeon_fallback_vtxfmt;