diff options
author | marha <marha@users.sourceforge.net> | 2011-04-27 06:58:32 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-27 06:58:32 +0000 |
commit | 96d6df5da9cddedf4931bf8e17f96e242467c661 (patch) | |
tree | 07977c913b04e80b7dbd302e7a5890422aeacb1b /mesalib/src/mesa/program/arbprogparse.c | |
parent | 71372d36e1a3f0230b88808f70d35446fda12260 (diff) | |
download | vcxsrv-96d6df5da9cddedf4931bf8e17f96e242467c661.tar.gz vcxsrv-96d6df5da9cddedf4931bf8e17f96e242467c661.tar.bz2 vcxsrv-96d6df5da9cddedf4931bf8e17f96e242467c661.zip |
xserver libX11 libxtrans mesa pixman xkeyboard-config git update 27 Apr 2011
Diffstat (limited to 'mesalib/src/mesa/program/arbprogparse.c')
-rw-r--r-- | mesalib/src/mesa/program/arbprogparse.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mesalib/src/mesa/program/arbprogparse.c b/mesalib/src/mesa/program/arbprogparse.c index 7f778c3c3..dffc8abf7 100644 --- a/mesalib/src/mesa/program/arbprogparse.c +++ b/mesalib/src/mesa/program/arbprogparse.c @@ -116,20 +116,11 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, program->Base.SamplersUsed |= (1 << i); } program->Base.ShadowSamplers = prog.ShadowSamplers; - switch (state.option.Fog) { - case OPTION_FOG_EXP: program->FogOption = GL_EXP; break; - case OPTION_FOG_EXP2: program->FogOption = GL_EXP2; break; - case OPTION_FOG_LINEAR: program->FogOption = GL_LINEAR; break; - default: program->FogOption = GL_NONE; break; - } program->OriginUpperLeft = state.option.OriginUpperLeft; program->PixelCenterInteger = state.option.PixelCenterInteger; program->UsesKill = state.fragment.UsesKill; - if (program->FogOption) - program->Base.InputsRead |= FRAG_BIT_FOGC; - if (program->Base.Instructions) free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; @@ -143,12 +134,15 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, * there's no hardware that wants to do fog in a discrete stage separate * from the fragment shader. */ - if (program->FogOption != GL_NONE) { + if (state.option.Fog != OPTION_NONE) { + static const GLenum fog_modes[4] = { + GL_NONE, GL_EXP, GL_EXP2, GL_LINEAR + }; + /* XXX: we should somehow recompile this to remove clamping if disabled * On the ATI driver, this is unclampled if fragment clamping is disabled */ - _mesa_append_fog_code(ctx, program, GL_TRUE); - program->FogOption = GL_NONE; + _mesa_append_fog_code(ctx, program, fog_modes[state.option.Fog], GL_TRUE); } #if DEBUG_FP |