st/vega: Fix pipe blend state for various blend modes.
authorChia-I Wu <olv@lunarg.com>
Sat, 4 Dec 2010 13:42:51 +0000 (21:42 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 4 Dec 2010 15:46:38 +0000 (23:46 +0800)
commit859106f196ade77f59f8787b071739901cd1a843
tree632ca04f16bcf6ad64614b3cf86b278181591099
parent0ee73edeccd21034e03e9e43dd0d09fa6fbf7842
st/vega: Fix pipe blend state for various blend modes.

rgb_src_factor and rgb_dst_factor should be PIPE_BLENDFACTOR_ONE for
VG_BLEND_SRC_IN and VG_BLEND_DST_IN respectively.  VG_BLEND_SRC_OVER can
be supported only when the fb has no alpha channel.  VG_BLEND_DST_OVER
and VG_BLEND_ADDITIVE have to be supported with a shader.

Note that Porter-Duff blending rules assume premultiplied alpha.
src/gallium/state_trackers/vega/renderer.c
src/gallium/state_trackers/vega/shader.c
src/gallium/state_trackers/vega/vg_context.c