diff options
author | Miklós Máté <[email protected]> | 2016-08-06 15:34:00 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-08-09 07:46:37 -0600 |
commit | d9519c6f069d2784b2b5eec45085cf21223888de (patch) | |
tree | 86c905c13e0d720fe8de6f8b0d27b38b7e3a6549 /src/mesa | |
parent | 06b2fd04f6bc2f511f0c67a9b18f01b8f7296edc (diff) |
mesa: simplify ff fs generator a bit
Literally.
Signed-off-by: Miklós Máté <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/ff_fragment_shader.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp index 1f9a7cfeadd..db3736eae77 100644 --- a/src/mesa/main/ff_fragment_shader.cpp +++ b/src/mesa/main/ff_fragment_shader.cpp @@ -103,7 +103,6 @@ struct state_key { GLuint nr_enabled_units:8; GLuint enabled_units:8; GLuint separate_specular:1; - GLuint fog_enabled:1; GLuint fog_mode:2; /**< FOG_x */ GLuint inputs_available:12; GLuint num_draw_buffers:4; @@ -127,10 +126,10 @@ struct state_key { } unit[MAX_TEXTURE_UNITS]; }; -#define FOG_LINEAR 0 -#define FOG_EXP 1 -#define FOG_EXP2 2 -#define FOG_UNKNOWN 3 +#define FOG_NONE 0 +#define FOG_LINEAR 1 +#define FOG_EXP 2 +#define FOG_EXP2 3 static GLuint translate_fog_mode( GLenum mode ) { @@ -138,7 +137,7 @@ static GLuint translate_fog_mode( GLenum mode ) case GL_LINEAR: return FOG_LINEAR; case GL_EXP: return FOG_EXP; case GL_EXP2: return FOG_EXP2; - default: return FOG_UNKNOWN; + default: return FOG_NONE; } } @@ -463,7 +462,6 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key ) /* _NEW_FOG */ if (ctx->Fog.Enabled) { - key->fog_enabled = 1; key->fog_mode = translate_fog_mode(ctx->Fog.Mode); inputs_referenced |= VARYING_BIT_FOGC; /* maybe */ } @@ -1182,7 +1180,7 @@ emit_instructions(texenv_fragment_program *p) cf = new(p->mem_ctx) ir_dereference_variable(spec_result); } - if (key->fog_enabled) { + if (key->fog_mode) { cf = emit_fog_instructions(p, cf); } |