llvmpipe: Tighten check for alpha-only formats
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 19 Mar 2014 17:12:38 +0000 (17:12 +0000)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 20 Mar 2014 15:50:40 +0000 (16:50 +0100)
The AoS version of ld_build_blend_factor was assuming that if the first
channel was alpha, there were no rgb components.

Fixes glean/blendFunc on System z.  No piglit regressions on x86_64.
The shortcut is still used in tests like spec/ARB_framebuffer_object/
fbo-alpha.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c

index 377eaa5a6e09f69f6d7a1e72400854c8c8bc4d60..564e19a156516674962f2fdf8297c26213349d7e 100644 (file)
@@ -255,7 +255,7 @@ lp_build_blend_factor(struct lp_build_blend_aos_context *bld,
    LLVMValueRef rgb_factor_, alpha_factor_;
    enum lp_build_blend_swizzle rgb_swizzle;
 
-   if (alpha_swizzle == 0) {
+   if (alpha_swizzle == UTIL_FORMAT_SWIZZLE_X && num_channels == 1) {
       return lp_build_blend_factor_unswizzled(bld, alpha_factor, TRUE);
    }