summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-03 17:13:04 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-03 17:13:04 -0600
commit111880798a7b67b79af3f7986e3297268c4b778a (patch)
tree502450becc425f1bffe2a9bdfbe416bb8d394e18 /src/mesa/state_tracker
parentf6d4f5e1e9d626356311e1868b35b79d355af739 (diff)
Blend MIN/MAX modes are special: the src/dest terms are always one.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_blend.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
index 03fbd290e0e..e0215c9eefe 100644
--- a/src/mesa/state_tracker/st_atom_blend.c
+++ b/src/mesa/state_tracker/st_atom_blend.c
@@ -169,12 +169,28 @@ update_blend( struct st_context *st )
blend.blend_enable = 1;
blend.rgb_func = gl_blend_to_sp(st->ctx->Color.BlendEquationRGB);
- blend.rgb_src_factor = gl_blend_to_sp(st->ctx->Color.BlendSrcRGB);
- blend.rgb_dst_factor = gl_blend_to_sp(st->ctx->Color.BlendDstRGB);
+ if (st->ctx->Color.BlendEquationRGB == GL_MIN ||
+ st->ctx->Color.BlendEquationRGB == GL_MAX) {
+ /* Min/max are special */
+ blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend.rgb_src_factor = gl_blend_to_sp(st->ctx->Color.BlendSrcRGB);
+ blend.rgb_dst_factor = gl_blend_to_sp(st->ctx->Color.BlendDstRGB);
+ }
blend.alpha_func = gl_blend_to_sp(st->ctx->Color.BlendEquationA);
- blend.alpha_src_factor = gl_blend_to_sp(st->ctx->Color.BlendSrcA);
- blend.alpha_dst_factor = gl_blend_to_sp(st->ctx->Color.BlendDstA);
+ if (st->ctx->Color.BlendEquationA == GL_MIN ||
+ st->ctx->Color.BlendEquationA == GL_MAX) {
+ /* Min/max are special */
+ blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend.alpha_src_factor = gl_blend_to_sp(st->ctx->Color.BlendSrcA);
+ blend.alpha_dst_factor = gl_blend_to_sp(st->ctx->Color.BlendDstA);
+ }
}
else {
/* no blending / logicop */