summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/arbprogparse.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-03-25 11:32:31 -0600
committerBrian Paul <[email protected]>2008-03-25 11:47:35 -0600
commitc0ef16647424452ba60e165c82c59f5ff64f12d4 (patch)
treec8c7ba0ad0af0445aa5692d41ce12e7f8ccf43c5 /src/mesa/shader/arbprogparse.c
parentbedb93e989340a2d65ed2fb28af7410983cb484d (diff)
mesa: append fog instructions after parsing if a fog option is set
Drivers don't have to worry about it then.
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r--src/mesa/shader/arbprogparse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index 6782491cc50..6648ed7b719 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -35,6 +35,7 @@
#include "shader/grammar/grammar_mesa.h"
#include "arbprogparse.h"
#include "program.h"
+#include "programopt.h"
#include "prog_parameter.h"
#include "prog_statevars.h"
#include "context.h"
@@ -3929,6 +3930,16 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
_mesa_free_parameter_list(program->Base.Parameters);
program->Base.Parameters = ap.Base.Parameters;
+ /* Append fog instructions now if the program has "OPTION ARB_fog_exp"
+ * or similar. We used to leave this up to drivers, but it appears
+ * there's no hardware that wants to do fog in a discrete stage separate
+ * from the fragment shader.
+ */
+ if (program->FogOption != GL_NONE) {
+ _mesa_append_fog_code(ctx, program);
+ program->FogOption = GL_NONE;
+ }
+
#if DEBUG_FP
_mesa_printf("____________Fragment program %u ________\n", program->Base.ID);
_mesa_print_program(&program->Base);