Mesa (refs/tags/mesa-7.8.1): softpipe: index the correct blend/ mask state index

Ian Romanick idr at kemper.freedesktop.org
Mon Apr 5 19:47:37 UTC 2010


Module: Mesa
Branch: refs/tags/mesa-7.8.1
Commit: 0eea33b0696cee2cdea1e63a1714cec267d9b990
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0eea33b0696cee2cdea1e63a1714cec267d9b990

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Apr  5 11:00:52 2010 -0600

softpipe: index the correct blend/mask state index

Need to check pipe_blend_state::independent_blend_enable to determine
which render target/index to use when checking blend enable and colormask
state.

This is part of the fix for piglit/fbo-drawbuffers

---

 src/gallium/drivers/softpipe/sp_quad_blend.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c
index d65307b..ead4893 100644
--- a/src/gallium/drivers/softpipe/sp_quad_blend.c
+++ b/src/gallium/drivers/softpipe/sp_quad_blend.c
@@ -744,6 +744,8 @@ blend_fallback(struct quad_stage *qs,
 
    for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) 
    {
+      /* which blend/mask state index to use: */
+      const uint blend_buf = blend->independent_blend_enable ? cbuf : 0;
       float dest[4][QUAD_SIZE];
       struct softpipe_cached_tile *tile
          = sp_get_cached_tile(softpipe->cbuf_cache[cbuf],
@@ -771,11 +773,11 @@ blend_fallback(struct quad_stage *qs,
          if (blend->logicop_enable) {
             logicop_quad( qs, quadColor, dest );
          }
-         else if (blend->rt[cbuf].blend_enable) {
+         else if (blend->rt[blend_buf].blend_enable) {
             blend_quad( qs, quadColor, dest, cbuf );
          }
 
-         if (blend->rt[cbuf].colormask != 0xf)
+         if (blend->rt[blend_buf].colormask != 0xf)
             colormask_quad( blend->rt[cbuf].colormask, quadColor, dest);
    
          /* Output color values




More information about the mesa-commit mailing list