From 2d61d301171620efe624d83a5457f4094eb49cba Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 17 Oct 2005 00:54:12 +0000 Subject: 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). --- src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_maos_verts.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 24e681c8c0..91a60bb9f1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -63,8 +63,11 @@ static struct { #define DO_W (IND & RADEON_CP_VC_FRMT_W0) #define DO_RGBA (IND & RADEON_CP_VC_FRMT_PKCOLOR) -#define DO_SPEC (IND & RADEON_CP_VC_FRMT_PKSPEC) -#define DO_FOG (IND & RADEON_CP_VC_FRMT_PKSPEC) +#define DO_SPEC_OR_FOG (IND & RADEON_CP_VC_FRMT_PKSPEC) +#define DO_SPEC ((IND & RADEON_CP_VC_FRMT_PKSPEC) && \ + (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)) +#define DO_FOG ((IND & RADEON_CP_VC_FRMT_PKSPEC) && ctx->Fog.Enabled && \ + (ctx->Fog.FogCoordinateSource == GL_FOG_COORD)) #define DO_TEX0 (IND & RADEON_CP_VC_FRMT_ST0) #define DO_TEX1 (IND & RADEON_CP_VC_FRMT_ST1) #define DO_TEX2 (IND & RADEON_CP_VC_FRMT_ST2) @@ -337,7 +340,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) req |= RADEON_CP_VC_FRMT_PKCOLOR; } - if (inputs & VERT_BIT_COLOR1) { + if (inputs & (VERT_BIT_COLOR1|VERT_BIT_FOG)) { req |= RADEON_CP_VC_FRMT_PKSPEC; } -- cgit v1.2.3