- blend->alpha_func = translate_blend(st->ctx->Color.BlendEquationA);
- 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 = translate_blend(st->ctx->Color.BlendSrcA);
- blend->alpha_dst_factor = translate_blend(st->ctx->Color.BlendDstA);
+ blend->rt[i].blend_enable = (ctx->Color.BlendEnabled >> i) & 0x1;
+
+ if (ctx->Extensions.ARB_draw_buffers_blend)
+ j = i;
+
+ blend->rt[i].rgb_func =
+ translate_blend(ctx->Color.Blend[j].EquationRGB);
+
+ if (ctx->Color.Blend[i].EquationRGB == GL_MIN ||
+ ctx->Color.Blend[i].EquationRGB == GL_MAX) {
+ /* Min/max are special */
+ blend->rt[i].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[i].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend->rt[i].rgb_src_factor =
+ translate_blend(ctx->Color.Blend[j].SrcRGB);
+ blend->rt[i].rgb_dst_factor =
+ translate_blend(ctx->Color.Blend[j].DstRGB);
+ }
+
+ blend->rt[i].alpha_func =
+ translate_blend(ctx->Color.Blend[j].EquationA);
+
+ if (ctx->Color.Blend[i].EquationA == GL_MIN ||
+ ctx->Color.Blend[i].EquationA == GL_MAX) {
+ /* Min/max are special */
+ blend->rt[i].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[i].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+ }
+ else {
+ blend->rt[i].alpha_src_factor =
+ translate_blend(ctx->Color.Blend[j].SrcA);
+ blend->rt[i].alpha_dst_factor =
+ translate_blend(ctx->Color.Blend[j].DstA);
+ }