Disable vertex shader fog, compute fog in fragment shader.
This commit is contained in:
@@ -1097,15 +1097,21 @@ create_new_program(GLcontext *ctx, struct state_key *key,
|
|||||||
ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
|
ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS);
|
||||||
|
|
||||||
/* Allocate final instruction array */
|
/* Allocate final instruction array */
|
||||||
program->Base.Instructions
|
p.program->Base.Instructions
|
||||||
= _mesa_alloc_instructions(program->Base.NumInstructions);
|
= _mesa_alloc_instructions(p.program->Base.NumInstructions);
|
||||||
if (!program->Base.Instructions) {
|
if (!p.program->Base.Instructions) {
|
||||||
_mesa_error(ctx, GL_OUT_OF_MEMORY,
|
_mesa_error(ctx, GL_OUT_OF_MEMORY,
|
||||||
"generating tex env program");
|
"generating tex env program");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_mesa_copy_instructions(program->Base.Instructions, instBuffer,
|
_mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
|
||||||
program->Base.NumInstructions);
|
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.
|
/* Notify driver the fragment program has (actually) changed.
|
||||||
*/
|
*/
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "main/imports.h"
|
#include "main/imports.h"
|
||||||
|
#include "main/extensions.h"
|
||||||
|
#include "tnl/tnl.h"
|
||||||
#include "vbo/vbo.h"
|
#include "vbo/vbo.h"
|
||||||
#include "st_public.h"
|
#include "st_public.h"
|
||||||
#include "st_context.h"
|
#include "st_context.h"
|
||||||
@@ -98,6 +100,9 @@ struct st_context *st_create_context( GLcontext *ctx,
|
|||||||
/* XXXX This is temporary! */
|
/* XXXX This is temporary! */
|
||||||
_mesa_enable_sw_extensions(ctx);
|
_mesa_enable_sw_extensions(ctx);
|
||||||
|
|
||||||
|
/* we'll always do per-pixel fog in the fragment shader */
|
||||||
|
_tnl_allow_vertex_fog(ctx, GL_FALSE);
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user