llvmpipe: fix blending for intensity formats
authorDave Airlie <airlied@gmail.com>
Fri, 30 Dec 2011 20:10:26 +0000 (20:10 +0000)
committerDave Airlie <airlied@redhat.com>
Sat, 31 Dec 2011 12:37:48 +0000 (12:37 +0000)
This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 5af74fe..53e35ef 100644 (file)
@@ -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;