mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
Blend MIN/MAX modes are special: the src/dest terms are always one.
This commit is contained in:
parent
f6d4f5e1e9
commit
111880798a
1 changed files with 20 additions and 4 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue