llvmpipe: use alpha from already converted color if possible
authorRoland Scheidegger <sroland@vmware.com>
Thu, 22 Dec 2016 02:49:22 +0000 (03:49 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 6 Jan 2017 22:13:34 +0000 (23:13 +0100)
commit04480a04b10524e156cb01d5f7bd8ec02fcc4a67
treefda9490bf6687184492195178ea3d1c0b0217674
parent53c2d24a24a631a5be0a9c4df88f23dda1e8685c
llvmpipe: use alpha from already converted color if possible

For rgbx formats, there is no point in doing alpha conversion again (and
with different tranpose even, so llvm can't eliminate it).
Albeit it looks like there's some minimal changes needed in the blend code
(found by code inspection, no test seemed to complain) if we do this -
the blend factors are already sanitized if we have no destination alpha,
however for src_alpha_saturate it looks like it still might make a
difference (note that we forced has_alpha to true before for some formats
and nothing complained, but this seems safer).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
src/gallium/drivers/llvmpipe/lp_state_fs.c