Mesa (7.9): mesa: fix num_draw_buffers== 0 in fixed-function fragment program generation
Brian Paul
brianp at kemper.freedesktop.org
Tue Feb 22 01:20:21 UTC 2011
Module: Mesa
Branch: 7.9
Commit: d1424f0185fda236fe90f181d135bf86d03f0c6f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1424f0185fda236fe90f181d135bf86d03f0c6f
Author: Brian Paul <brianp at vmware.com>
Date: Wed Jan 12 17:32:00 2011 -0700
mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE). The fragment program
was writing to color output[0] but OutputsWritten was 0. That led to a
failed assertion in the Mesa->TGSI translation code.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2fa6012f6a0b02de6093cbccba3bf4432f072e57)
---
src/mesa/main/texenvprogram.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 20f02ce..b1849d8 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -1465,7 +1465,7 @@ create_new_program(GLcontext *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 */
@@ -1558,7 +1558,7 @@ create_new_program(GLcontext *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;
}
More information about the mesa-commit
mailing list