summaryrefslogtreecommitdiff
path: root/src/mesa/main/texenvprogram.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texenvprogram.c')
-rw-r--r--src/mesa/main/texenvprogram.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index a8bffe416d..c1380f2a64 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -28,6 +28,7 @@
#include "glheader.h"
#include "imports.h"
+#include "mtypes.h"
#include "program/program.h"
#include "program/prog_parameter.h"
#include "program/prog_cache.h"
@@ -1466,7 +1467,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key,
p.last_tex_stage = 0;
release_temps(ctx, &p);
- if (key->enabled_units) {
+ if (key->enabled_units && key->num_draw_buffers) {
GLboolean needbumpstage = GL_FALSE;
/* Zeroth pass - bump map textures first */
@@ -1559,7 +1560,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key,
_mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
p.program->Base.NumInstructions);
- if (p.program->FogOption) {
+ if (key->num_draw_buffers && p.program->FogOption) {
_mesa_append_fog_code(ctx, p.program);
p.program->FogOption = GL_NONE;
}