summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/vega/vg_context.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-12-04 21:42:51 +0800
committerChia-I Wu <olv@lunarg.com>2010-12-04 23:46:38 +0800
commit859106f196ade77f59f8787b071739901cd1a843 (patch)
tree632ca04f16bcf6ad64614b3cf86b278181591099 /src/gallium/state_trackers/vega/vg_context.c
parent0ee73edeccd21034e03e9e43dd0d09fa6fbf7842 (diff)
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.
Diffstat (limited to 'src/gallium/state_trackers/vega/vg_context.c')
-rw-r--r--src/gallium/state_trackers/vega/vg_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c
index 5479edc861..0844012cc3 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -400,6 +400,10 @@ void vg_validate_state(struct vg_context *ctx)
if (vg_context_update_depth_stencil_rb(ctx, stfb->width, stfb->height))
ctx->state.dirty |= DEPTH_STENCIL_DIRTY;
+ /* blend state depends on fb format */
+ if (ctx->state.dirty & FRAMEBUFFER_DIRTY)
+ ctx->state.dirty |= BLEND_DIRTY;
+
renderer_validate(ctx->renderer, ctx->state.dirty,
ctx->draw_buffer, &ctx->state.vg);