aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/sis/sis_fog.c
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2003-12-04 18:17:32 +0000
committerAlan Hourihane <[email protected]>2003-12-04 18:17:32 +0000
commite78dd78e4af644fbad6cd8f3135ec7364bd54a5f (patch)
treec66c1344f2d5f77d452c2bb86ca3a1006eca1aad /src/mesa/drivers/dri/sis/sis_fog.c
parentecb1a5f7f98b9e42965318db99b6996f12b87e59 (diff)
merge latest DRI sis driver changes from the DRI trunk
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_fog.c')
-rw-r--r--src/mesa/drivers/dri/sis/sis_fog.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_fog.c b/src/mesa/drivers/dri/sis/sis_fog.c
index 8daa9a0f5e3..e1230f6b403 100644
--- a/src/mesa/drivers/dri/sis/sis_fog.c
+++ b/src/mesa/drivers/dri/sis/sis_fog.c
@@ -18,7 +18,7 @@ Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
-ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -35,6 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sis_context.h"
#include "sis_state.h"
#include "swrast/swrast.h"
+
#include "macros.h"
static GLint convertFtToFogFt( GLfloat dwInValue );
@@ -43,6 +44,7 @@ void
sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
+ __GLSiSHardware *prev = &smesa->prev;
__GLSiSHardware *current = &smesa->current;
float fArg;
@@ -56,29 +58,25 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
{
case GL_LINEAR:
current->hwFog |= FOGMODE_LINEAR;
- _swrast_allow_pixel_fog( ctx, GL_TRUE );
- _swrast_allow_vertex_fog( ctx, GL_FALSE );
break;
case GL_EXP:
- if (ctx->Hint.Fog == GL_NICEST || smesa->AGPCmdModeEnabled) {
- current->hwFog |= FOGMODE_EXP;
- _swrast_allow_pixel_fog( ctx, GL_TRUE );
- _swrast_allow_vertex_fog( ctx, GL_FALSE );
- } else { /* GL_DONTCARE or GL_FASTEST */
- current->hwFog |= FOGMODE_CHEAP;
- _swrast_allow_pixel_fog( ctx, GL_FALSE );
- _swrast_allow_vertex_fog( ctx, GL_TRUE );
- }
+ current->hwFog |= FOGMODE_EXP;
break;
case GL_EXP2:
current->hwFog |= FOGMODE_EXP2;
- _swrast_allow_pixel_fog( ctx, GL_TRUE );
- _swrast_allow_vertex_fog( ctx, GL_FALSE );
break;
}
+ if (current->hwFog != prev->hwFog) {
+ prev->hwFog = current->hwFog;
+ smesa->GlobalFlag |= GFLAG_FOGSETTING;
+ }
break;
case GL_FOG_DENSITY:
current->hwFogDensity = convertFtToFogFt( ctx->Fog.Density );
+ if (current->hwFogDensity != prev->hwFogDensity) {
+ prev->hwFogDensity = current->hwFogDensity;
+ smesa->GlobalFlag |= GFLAG_FOGSETTING;
+ }
break;
case GL_FOG_START:
case GL_FOG_END:
@@ -91,6 +89,13 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
else
current->hwFogFar = doFPtoFixedNoRound( ctx->Fog.End, 6 );
}
+ if (current->hwFogFar != prev->hwFogFar ||
+ current->hwFogInverse != prev->hwFogInverse)
+ {
+ prev->hwFogFar = current->hwFogFar;
+ prev->hwFogInverse = current->hwFogInverse;
+ smesa->GlobalFlag |= GFLAG_FOGSETTING;
+ }
break;
case GL_FOG_INDEX:
/* TODO */
@@ -101,6 +106,10 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[2] );
current->hwFog &= 0xff000000;
current->hwFog |= fogColor;
+ if (current->hwFog != prev->hwFog) {
+ prev->hwFog = current->hwFog;
+ smesa->GlobalFlag |= GFLAG_FOGSETTING;
+ }
break;
}
}