Mesa (master): i965/fs: Fix regression in fbo-alphatest-nocolor.

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 30 21:42:24 UTC 2011


Module: Mesa
Branch: master
Commit: 51e5a266c1e1c12c4f0d82bee3caff008a41c9fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=51e5a266c1e1c12c4f0d82bee3caff008a41c9fd

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 23 10:20:12 2011 -0800

i965/fs: Fix regression in fbo-alphatest-nocolor.

In the refactor for handling user-defined out params, we failed to set
up the new color output tracking when there was no color drawbuffer in
place but alpha testing was on.  Just always set up at least one when
handling gl_FragColor, since we won't make use of its value unless we
need to.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42806

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index a76ba96..2085727 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -74,7 +74,7 @@ fs_visitor::visit(ir_variable *ir)
 
       if (ir->location == FRAG_RESULT_COLOR) {
 	 /* Writing gl_FragColor outputs to all color regions. */
-	 for (int i = 0; i < c->key.nr_color_regions; i++) {
+	 for (int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) {
 	    this->outputs[i] = *reg;
 	 }
       } else if (ir->location == FRAG_RESULT_DEPTH) {




More information about the mesa-commit mailing list