summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-04-15 19:23:13 -0700
committerIan Romanick <[email protected]>2011-04-21 17:33:35 -0700
commitc41cb17037777de6e4ae596e56a16239429486e9 (patch)
treef0ad8f12eb39b5611a8732e2b5de2fd18ea943d8 /src
parent8fc5ed18bc0d299a4495b28f02e63b1b75326bbc (diff)
i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function. Because of this, there's no reason to handle cases where there is no fragment program for fog. Reviewed-by: Eric Anholt <[email protected]> Acked-by: Corbin Simpson <[email protected]> Acked-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 05fc26f68f7..df100314be9 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -729,36 +729,15 @@ void
i915_update_fog(struct gl_context * ctx)
{
struct i915_context *i915 = I915_CONTEXT(ctx);
- GLenum mode;
- GLboolean enabled;
GLuint dw;
- if (ctx->FragmentProgram._Current) {
- /* Pull in static fog state from program */
- mode = GL_NONE;
- enabled = GL_FALSE;
- }
- else {
- enabled = ctx->Fog.Enabled;
- mode = ctx->Fog.Mode;
- }
+ assert(ctx->FragmentProgram._Current);
- if (!enabled) {
- i915->vertex_fog = I915_FOG_NONE;
- }
- else { /* if (i915->vertex_fog != I915_FOG_VERTEX) */
- I915_STATECHANGE(i915, I915_UPLOAD_FOG);
- i915->state.Fog[I915_FOGREG_MODE1] &= ~FMC1_FOGFUNC_MASK;
- i915->state.Fog[I915_FOGREG_MODE1] |= FMC1_FOGFUNC_VERTEX;
- i915->vertex_fog = I915_FOG_VERTEX;
- }
+ i915->vertex_fog = I915_FOG_NONE;
+
+ I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, 0);
+ dw = i915->state.Ctx[I915_CTXREG_LIS5] & ~S5_FOG_ENABLE;
- I915_ACTIVESTATE(i915, I915_UPLOAD_FOG, enabled);
- dw = i915->state.Ctx[I915_CTXREG_LIS5];
- if (enabled)
- dw |= S5_FOG_ENABLE;
- else
- dw &= ~S5_FOG_ENABLE;
if (dw != i915->state.Ctx[I915_CTXREG_LIS5]) {
i915->state.Ctx[I915_CTXREG_LIS5] = dw;
I915_STATECHANGE(i915, I915_UPLOAD_CTX);