summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-25 15:18:51 -0600
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-24 10:04:17 -0700
commitc81cce78313a62e0d36a5c80bd9d35b770d0814a (patch)
tree2a0e0fe9c6e826c325a23046e12d6c4100222072 /src/mesa
parent19d77d6cfa384142cc6ab4d9b3db4b28cefb6f19 (diff)
Disable vertex shader fog, compute fog in fragment shader.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texenvprogram.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index d471030f14..7387f4fb2f 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -1116,15 +1116,21 @@ create_new_program(GLcontext *ctx, struct state_key *key,
ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
/* Allocate final instruction array */
- program->Base.Instructions
- = _mesa_alloc_instructions(program->Base.NumInstructions);
- if (!program->Base.Instructions) {
+ p.program->Base.Instructions
+ = _mesa_alloc_instructions(p.program->Base.NumInstructions);
+ if (!p.program->Base.Instructions) {
_mesa_error(ctx, GL_OUT_OF_MEMORY,
"generating tex env program");
return;
}
- _mesa_copy_instructions(program->Base.Instructions, instBuffer,
- program->Base.NumInstructions);
+ _mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
+ p.program->Base.NumInstructions);
+
+ if (p.program->FogOption) {
+ _mesa_append_fog_code(ctx, p.program);
+ p.program->FogOption = GL_NONE;
+ }
+
/* Notify driver the fragment program has (actually) changed.
*/