Mesa (master): llvmpipe: fix blending for intensity formats

Dave Airlie airlied at kemper.freedesktop.org
Sat Dec 31 13:01:51 UTC 2011


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

Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Dec 30 20:10:26 2011 +0000

llvmpipe: fix blending for intensity formats

This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 5af74fe..53e35ef 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1294,7 +1294,8 @@ make_variant_key(struct llvmpipe_context *lp,
        *
        * Also, force rgb/alpha func/factors match, to make AoS blending easier.
        */
-      if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W) {
+      if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W ||
+	  format_desc->swizzle[3] == format_desc->swizzle[0]) {
          blend_rt->rgb_src_factor   = force_dst_alpha_one(blend_rt->rgb_src_factor);
          blend_rt->rgb_dst_factor   = force_dst_alpha_one(blend_rt->rgb_dst_factor);
          blend_rt->alpha_func       = blend_rt->rgb_func;




More information about the mesa-commit mailing list