From: Eric Anholt Date: Thu, 27 Oct 2005 19:59:41 +0000 (+0000) Subject: Bug #4900: Fix the non-fogcoord fog test on r100 (and rv200) at tcl_mode=1 by X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=512c994b92126a7575bb3cc327da40710b43f52c;p=mesa.git Bug #4900: Fix the non-fogcoord fog test on r100 (and rv200) at tcl_mode=1 by flipping the signs on two factors. While this contradicts the DDK, it matches what r200 does, and it fixes the test. --- diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 681de914e83..e0c3286195d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -361,7 +361,10 @@ static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) switch (ctx->Fog.Mode) { case GL_EXP: c.f = 0.0; - d.f = ctx->Fog.Density; + /* While this is the opposite sign from the DDK, it makes the fog test + * pass, and matches r200. + */ + d.f = -ctx->Fog.Density; break; case GL_EXP2: c.f = 0.0; @@ -373,7 +376,10 @@ static void radeonFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) d.f = 1.0F; } else { c.f = ctx->Fog.End/(ctx->Fog.End-ctx->Fog.Start); - d.f = 1.0/(ctx->Fog.End-ctx->Fog.Start); + /* While this is the opposite sign from the DDK, it makes the fog + * test pass, and matches r200. + */ + d.f = -1.0/(ctx->Fog.End-ctx->Fog.Start); } break; default: