summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/i915_state.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-04-15 22:20:09 -0700
committerIan Romanick <[email protected]>2011-04-21 17:33:41 -0700
commitd439491a77cf9f25ea7a7f9c2309d2542d87f83e (patch)
tree198b3ef814f41360dbac1f20887dce5672206526 /src/mesa/drivers/dri/i915/i915_state.c
parent499f7c0114cca195c9569c202ae099ef0277b010 (diff)
i915: Gut all remaining bits of hardware fog
None of this ever gets used. Fog is always calculated by a fragment program. Even though the fixed-function fog unit is never used, state updates are still sent to the hardware. Removing those spurious state updates can't hurt performance. Reviewed-by: Eric Anholt <[email protected]> Acked-by: Corbin Simpson <[email protected]> Acked-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i915/i915_state.c')
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c93
1 files changed, 7 insertions, 86 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index d027426e2ab..99212ad4fd1 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -724,79 +724,17 @@ i915ShadeModel(struct gl_context * ctx, GLenum mode)
/* =============================================================
* Fog
+ *
+ * This empty function remains because _mesa_init_driver_state calls
+ * dd_function_table::Fogfv unconditionally. We have to have some function
+ * there so that it doesn't try to call a NULL pointer.
*/
-void
-i915_update_fog(struct gl_context * ctx)
-{
- struct i915_context *i915 = I915_CONTEXT(ctx);
- GLuint dw;
-
- assert(ctx->FragmentProgram._Current);
-
- I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, 0);
- dw = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_FOG_ENABLE;
-
- if (dw != i915->state.Ctx[I915_CTXREG_LIS5]) {
- i915->state.Ctx[I915_CTXREG_LIS5] = dw;
- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
- }
-
- /* Always enable pixel fog. Vertex fog using fog coord will conflict
- * with fog code appended onto fragment program.
- */
- _tnl_allow_vertex_fog( ctx, 0 );
- _tnl_allow_pixel_fog( ctx, 1 );
-}
-
static void
i915Fogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param)
{
- struct i915_context *i915 = I915_CONTEXT(ctx);
-
- switch (pname) {
- case GL_FOG_COORDINATE_SOURCE_EXT:
- case GL_FOG_MODE:
- case GL_FOG_START:
- case GL_FOG_END:
- break;
-
- case GL_FOG_DENSITY:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
-
- if (i915->state.Fog[I915_FOGREG_MODE1] & FMC1_FOGINDEX_Z) {
- i915->state.Fog[I915_FOGREG_MODE3] =
- (GLuint) (ctx->Fog.Density * FMC3_D_ONE);
- }
- else {
- fi_type fi;
- fi.f = ctx->Fog.Density;
- i915->state.Fog[I915_FOGREG_MODE3] = fi.i;
- }
- break;
-
- case GL_FOG_COLOR:
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_COLOR] =
- (_3DSTATE_FOG_COLOR_CMD |
- ((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) |
- ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) |
- ((GLubyte) (ctx->Fog.Color[2] * 255.0F) << 0));
- break;
-
- default:
- break;
- }
-}
-
-static void
-i915Hint(struct gl_context * ctx, GLenum target, GLenum state)
-{
- switch (target) {
- case GL_FOG_HINT:
- break;
- default:
- break;
- }
+ (void) ctx;
+ (void) pname;
+ (void) param;
}
/* =============================================================
@@ -893,9 +831,6 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
}
break;
- case GL_FOG:
- break;
-
case GL_CULL_FACE:
i915CullFaceFrontFace(ctx, 0);
break;
@@ -1029,19 +964,6 @@ i915_init_packets(struct i915_context *i915)
i915->state.Stipple[I915_STPREG_ST0] = _3DSTATE_STIPPLE;
}
-
- {
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE0] = _3DSTATE_FOG_MODE_CMD;
- i915->state.Fog[I915_FOGREG_MODE1] = (FMC1_FOGFUNC_MODIFY_ENABLE |
- FMC1_FOGFUNC_VERTEX |
- FMC1_FOGINDEX_MODIFY_ENABLE |
- FMC1_FOGINDEX_W |
- FMC1_C1_C2_MODIFY_ENABLE |
- FMC1_DENSITY_MODIFY_ENABLE);
- i915->state.Fog[I915_FOGREG_COLOR] = _3DSTATE_FOG_COLOR_CMD;
- }
-
{
i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
@@ -1124,7 +1046,6 @@ i915InitStateFunctions(struct dd_function_table *functions)
functions->Enable = i915Enable;
functions->Fogfv = i915Fogfv;
functions->FrontFace = i915CullFaceFrontFace;
- functions->Hint = i915Hint;
functions->LightModelfv = i915LightModelfv;
functions->LineWidth = i915LineWidth;
functions->LogicOpcode = i915LogicOp;