diff options
author | Brian <[email protected]> | 2007-09-25 15:18:51 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-09-25 15:18:51 -0600 |
commit | 3bf8d2ac7108a7f0f1722e411161e013bb8573f0 (patch) | |
tree | 536bbda0eb39dbf00e61b5ad8296fb776037e7ac /src/mesa/main | |
parent | 07f31a29b41be572c48fc1b440eaeb6a6b010cc8 (diff) |
Disable vertex shader fog, compute fog in fragment shader.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/texenvprogram.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 37f8fc80908..48c28d45ca2 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1097,15 +1097,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. */ |