Mesa (master): i915: Delete disabled try_pixel_fog paths

Ian Romanick idr at kemper.freedesktop.org
Thu Apr 21 17:34:36 PDT 2011


Module: Mesa
Branch: master
Commit: 8fc5ed18bc0d299a4495b28f02e63b1b75326bbc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8fc5ed18bc0d299a4495b28f02e63b1b75326bbc

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Apr 15 19:14:36 2011 -0700

i915: Delete disabled try_pixel_fog paths

Reviewed-by: Eric Anholt <eric at anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude at gmail.com>
Acked-by: Alex Deucher <alexdeucher at gmail.com>

---

 src/mesa/drivers/dri/i915/i915_state.c |   55 --------------------------------
 1 files changed, 0 insertions(+), 55 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 5c7c0c3..05fc26f 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -731,76 +731,21 @@ i915_update_fog(struct gl_context * ctx)
    struct i915_context *i915 = I915_CONTEXT(ctx);
    GLenum mode;
    GLboolean enabled;
-   GLboolean try_pixel_fog;
    GLuint dw;
 
    if (ctx->FragmentProgram._Current) {
       /* Pull in static fog state from program */
       mode = GL_NONE;
       enabled = GL_FALSE;
-      try_pixel_fog = 0;
    }
    else {
       enabled = ctx->Fog.Enabled;
       mode = ctx->Fog.Mode;
-#if 0
-      /* XXX - DISABLED -- Need ortho fallback */
-      try_pixel_fog = (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT
-                       && ctx->Hint.Fog == GL_NICEST);
-#else
-      try_pixel_fog = 0;
-#endif
    }
 
    if (!enabled) {
       i915->vertex_fog = I915_FOG_NONE;
    }
-   else if (try_pixel_fog) {
-      I915_STATECHANGE(i915, I915_UPLOAD_FOG);
-      i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
-      i915->vertex_fog = I915_FOG_PIXEL;
-
-      switch (mode) {
-      case GL_LINEAR:
-         if (ctx->Fog.End <= ctx->Fog.Start) {
-            /* XXX - this won't work with fragment programs.  Need to
-             * either fallback or append fog instructions to end of
-             * program in the case of linear fog.
-             */
-            printf("vertex fog!\n");
-            i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
-            i915->vertex_fog = I915_FOG_VERTEX;
-         }
-         else {
-            GLfloat c2 = 1.0 / (ctx->Fog.End - ctx->Fog.Start);
-            GLfloat c1 = ctx->Fog.End * c2;
-
-            i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_C1_MASK;
-            i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_LINEAR;
-            i915->state.Fog[I915_FOGREG_MODE1] |=
-               ((GLuint) (c1 * FMC1_C1_ONE)) & FMC1_C1_MASK;
-
-            if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
-               i915->state.Fog[I915_FOGREG_MODE2]
-                  = (GLuint) (c2 * FMC2_C2_ONE);
-            }
-            else {
-               fi_type fi;
-               fi.f = c2;
-               i915->state.Fog[I915_FOGREG_MODE2] = fi.i;
-            }
-         }
-         break;
-      case GL_EXP:
-         i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP;
-         break;
-      case GL_EXP2:
-         i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_PIXEL_EXP2;
-         break;
-      default:
-         break;
-      }
-   }
    else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
       I915_STATECHANGE(i915, I915_UPLOAD_FOG);
       i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;



More information about the mesa-commit mailing list