Mesa (master): mesa: fix texenv generation when num color bufs == 0
Brian Paul
brianp at kemper.freedesktop.org
Fri Jul 2 16:21:43 UTC 2010
Module: Mesa
Branch: master
Commit: 6e83420ee0ccb2228fab0f86a6e8bf8a6aefe57a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e83420ee0ccb2228fab0f86a6e8bf8a6aefe57a
Author: Brian Paul <brianp at vmware.com>
Date: Fri Jul 2 10:16:05 2010 -0600
mesa: fix texenv generation when num color bufs == 0
Before, if there were no color buffers enabled (with glDrawBuffers(GL_NONE))
when the texenv program was generated, we'd emit writes to OUTPUT[1] but
the OutputsWritten mask was 0. This inconsistency caused an assertion to
fail later in the Mesa->TGSI translation.
Fixes fd.o bug 28169
NOTE: this is a candidate for the 7.8 branch (and depends on commit
b6b9b17d27c570cc99ae339e595cf2f63ca5e8d7).
---
src/mesa/main/texenvprogram.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 6aa89d1..9fa8f02 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -1203,11 +1203,14 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit)
else
alpha_saturate = GL_FALSE;
- /* If this is the very last calculation, emit direct to output reg:
+ /* If this is the very last calculation (and various other conditions
+ * are met), emit directly to the color output register. Otherwise,
+ * emit to a temporary register.
*/
if (key->separate_specular ||
unit != p->last_tex_stage ||
alpha_shift ||
+ key->num_draw_buffers != 1 ||
rgb_shift)
dest = get_temp( p );
else
More information about the mesa-commit
mailing list