static const GLfloat zero[4] = { 0, 0, 0, 0 };
static const GLfloat one[4] = { 1, 1, 1, 1 };
struct softpipe_context *softpipe = qs->softpipe;
+ struct softpipe_surface *sps = softpipe_surface(softpipe->cbuf);
GLfloat source[4][QUAD_SIZE], dest[4][QUAD_SIZE];
- GLuint i;
-
- /* XXX we're also looping in output_quad() !?! */
-
- for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) {
- struct softpipe_surface *sps
- = softpipe_surface(softpipe->framebuffer.cbufs[i]);
- sps->read_quad_f_swz(sps, quad->x0, quad->y0, dest);
+ /* get colors from framebuffer */
+ sps->read_quad_f_swz(sps, quad->x0, quad->y0, dest);
- /*
- * Compute src/first term RGB
- */
- switch (softpipe->blend.rgb_src_factor) {
- case PIPE_BLENDFACTOR_ONE:
- VEC4_COPY(source[0], quad->outputs.color[0]); /* R */
- VEC4_COPY(source[1], quad->outputs.color[1]); /* G */
- VEC4_COPY(source[2], quad->outputs.color[2]); /* B */
- break;
- case PIPE_BLENDFACTOR_SRC_COLOR:
- VEC4_MUL(source[0], quad->outputs.color[0], quad->outputs.color[0]); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], quad->outputs.color[1]); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], quad->outputs.color[2]); /* B */
- break;
- case PIPE_BLENDFACTOR_SRC_ALPHA:
- {
- const GLfloat *alpha = quad->outputs.color[3];
- VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_DST_COLOR:
- VEC4_MUL(source[0], quad->outputs.color[0], dest[0]); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], dest[1]); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], dest[2]); /* B */
- break;
- case PIPE_BLENDFACTOR_DST_ALPHA:
- {
- const GLfloat *alpha = dest[3];
- VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
- assert(0); /* to do */
- break;
- case PIPE_BLENDFACTOR_CONST_COLOR:
- {
- GLfloat comp[4];
- VEC4_SCALAR(comp, softpipe->blend_color.color[0]); /* R */
- VEC4_MUL(source[0], quad->outputs.color[0], comp); /* R */
- VEC4_SCALAR(comp, softpipe->blend_color.color[1]); /* G */
- VEC4_MUL(source[1], quad->outputs.color[1], comp); /* G */
- VEC4_SCALAR(comp, softpipe->blend_color.color[2]); /* B */
- VEC4_MUL(source[2], quad->outputs.color[2], comp); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_CONST_ALPHA:
- {
- GLfloat alpha[4];
- VEC4_SCALAR(alpha, softpipe->blend_color.color[3]);
- VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_SRC1_COLOR:
- assert(0); /* to do */
- break;
- case PIPE_BLENDFACTOR_SRC1_ALPHA:
- assert(0); /* to do */
- break;
- case PIPE_BLENDFACTOR_ZERO:
- VEC4_COPY(source[0], zero); /* R */
- VEC4_COPY(source[1], zero); /* G */
- VEC4_COPY(source[2], zero); /* B */
- break;
- case PIPE_BLENDFACTOR_INV_SRC_COLOR:
- {
- GLfloat inv_comp[4];
- VEC4_SUB(inv_comp, one, quad->outputs.color[0]); /* R */
- VEC4_MUL(source[0], quad->outputs.color[0], inv_comp); /* R */
- VEC4_SUB(inv_comp, one, quad->outputs.color[1]); /* G */
- VEC4_MUL(source[1], quad->outputs.color[1], inv_comp); /* G */
- VEC4_SUB(inv_comp, one, quad->outputs.color[2]); /* B */
- VEC4_MUL(source[2], quad->outputs.color[2], inv_comp); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
- {
- GLfloat inv_alpha[4];
- VEC4_SUB(inv_alpha, one, quad->outputs.color[3]);
- VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_INV_DST_ALPHA:
- {
- GLfloat inv_alpha[4];
- VEC4_SUB(inv_alpha, one, dest[3]);
- VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_INV_DST_COLOR:
- {
- GLfloat inv_comp[4];
- VEC4_SUB(inv_comp, one, dest[0]); /* R */
- VEC4_MUL(source[0], quad->outputs.color[0], inv_comp); /* R */
- VEC4_SUB(inv_comp, one, dest[1]); /* G */
- VEC4_MUL(source[1], quad->outputs.color[1], inv_comp); /* G */
- VEC4_SUB(inv_comp, one, dest[2]); /* B */
- VEC4_MUL(source[2], quad->outputs.color[2], inv_comp); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_INV_CONST_COLOR:
- {
- GLfloat inv_comp[4];
- /* R */
- VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[0]);
- VEC4_MUL(source[0], quad->outputs.color[0], inv_comp);
- /* G */
- VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[1]);
- VEC4_MUL(source[1], quad->outputs.color[1], inv_comp);
- /* B */
- VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[2]);
- VEC4_MUL(source[2], quad->outputs.color[2], inv_comp);
- }
- break;
- case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
- {
- GLfloat alpha[4], inv_alpha[4];
- VEC4_SCALAR(alpha, 1.0 - softpipe->blend_color.color[3]);
- VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
- VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
- VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
- assert(0); /* to do */
- break;
- case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
- assert(0); /* to do */
- break;
- default:
- abort();
+ /*
+ * Compute src/first term RGB
+ */
+ switch (softpipe->blend.rgb_src_factor) {
+ case PIPE_BLENDFACTOR_ONE:
+ VEC4_COPY(source[0], quad->outputs.color[0]); /* R */
+ VEC4_COPY(source[1], quad->outputs.color[1]); /* G */
+ VEC4_COPY(source[2], quad->outputs.color[2]); /* B */
+ break;
+ case PIPE_BLENDFACTOR_SRC_COLOR:
+ VEC4_MUL(source[0], quad->outputs.color[0], quad->outputs.color[0]); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], quad->outputs.color[1]); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], quad->outputs.color[2]); /* B */
+ break;
+ case PIPE_BLENDFACTOR_SRC_ALPHA:
+ {
+ const GLfloat *alpha = quad->outputs.color[3];
+ VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
}
-
- /*
- * Compute src/first term A
- */
- switch (softpipe->blend.alpha_src_factor) {
- case PIPE_BLENDFACTOR_ONE:
- VEC4_COPY(source[3], quad->outputs.color[3]); /* A */
- break;
- case PIPE_BLENDFACTOR_SRC_ALPHA:
- {
- const GLfloat *alpha = quad->outputs.color[3];
- VEC4_MUL(source[3], quad->outputs.color[3], alpha); /* A */
- }
- break;
- case PIPE_BLENDFACTOR_ZERO:
- VEC4_COPY(source[3], zero); /* A */
- break;
- /* XXX fill in remaining terms */
- default:
- abort();
+ break;
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ VEC4_MUL(source[0], quad->outputs.color[0], dest[0]); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], dest[1]); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], dest[2]); /* B */
+ break;
+ case PIPE_BLENDFACTOR_DST_ALPHA:
+ {
+ const GLfloat *alpha = dest[3];
+ VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
}
-
-
- /*
- * Compute dest/second term RGB
- */
- switch (softpipe->blend.rgb_dst_factor) {
- case PIPE_BLENDFACTOR_ONE:
- /* dest = dest * 1 NO-OP, leave dest as-is */
- break;
- case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
- {
- GLfloat one_minus_alpha[QUAD_SIZE];
- VEC4_SUB(one_minus_alpha, one, quad->outputs.color[3]);
- VEC4_MUL(dest[0], dest[0], one_minus_alpha); /* R */
- VEC4_MUL(dest[1], dest[1], one_minus_alpha); /* G */
- VEC4_MUL(dest[2], dest[2], one_minus_alpha); /* B */
- }
- break;
- case PIPE_BLENDFACTOR_ZERO:
- VEC4_COPY(dest[0], zero); /* R */
- VEC4_COPY(dest[1], zero); /* G */
- VEC4_COPY(dest[2], zero); /* B */
- break;
- /* XXX fill in remaining terms */
- default:
- abort();
+ break;
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
+ assert(0); /* to do */
+ break;
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ {
+ GLfloat comp[4];
+ VEC4_SCALAR(comp, softpipe->blend_color.color[0]); /* R */
+ VEC4_MUL(source[0], quad->outputs.color[0], comp); /* R */
+ VEC4_SCALAR(comp, softpipe->blend_color.color[1]); /* G */
+ VEC4_MUL(source[1], quad->outputs.color[1], comp); /* G */
+ VEC4_SCALAR(comp, softpipe->blend_color.color[2]); /* B */
+ VEC4_MUL(source[2], quad->outputs.color[2], comp); /* B */
}
-
- /*
- * Compute dest/second term A
- */
- switch (softpipe->blend.alpha_dst_factor) {
- case PIPE_BLENDFACTOR_ONE:
- /* dest = dest * 1 NO-OP, leave dest as-is */
- break;
- case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
- {
- GLfloat one_minus_alpha[QUAD_SIZE];
- VEC4_SUB(one_minus_alpha, one, quad->outputs.color[3]);
- VEC4_MUL(dest[3], dest[3], one_minus_alpha); /* A */
- }
- break;
- case PIPE_BLENDFACTOR_ZERO:
- VEC4_COPY(dest[3], zero); /* A */
- break;
- /* XXX fill in remaining terms */
- default:
- abort();
+ break;
+ case PIPE_BLENDFACTOR_CONST_ALPHA:
+ {
+ GLfloat alpha[4];
+ VEC4_SCALAR(alpha, softpipe->blend_color.color[3]);
+ VEC4_MUL(source[0], quad->outputs.color[0], alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], alpha); /* B */
}
-
- /*
- * Combine RGB terms
- */
- switch (softpipe->blend.rgb_func) {
- case PIPE_BLEND_ADD:
- VEC4_ADD(quad->outputs.color[0], source[0], dest[0]); /* R */
- VEC4_ADD(quad->outputs.color[1], source[1], dest[1]); /* G */
- VEC4_ADD(quad->outputs.color[2], source[2], dest[2]); /* B */
- break;
- case PIPE_BLEND_SUBTRACT:
- VEC4_SUB(quad->outputs.color[0], source[0], dest[0]); /* R */
- VEC4_SUB(quad->outputs.color[1], source[1], dest[1]); /* G */
- VEC4_SUB(quad->outputs.color[2], source[2], dest[2]); /* B */
- break;
- case PIPE_BLEND_REVERSE_SUBTRACT:
- VEC4_SUB(quad->outputs.color[0], dest[0], source[0]); /* R */
- VEC4_SUB(quad->outputs.color[1], dest[1], source[1]); /* G */
- VEC4_SUB(quad->outputs.color[2], dest[2], source[2]); /* B */
- break;
- case PIPE_BLEND_MIN:
- VEC4_MIN(quad->outputs.color[0], source[0], dest[0]); /* R */
- VEC4_MIN(quad->outputs.color[1], source[1], dest[1]); /* G */
- VEC4_MIN(quad->outputs.color[2], source[2], dest[2]); /* B */
- break;
- case PIPE_BLEND_MAX:
- VEC4_MAX(quad->outputs.color[0], source[0], dest[0]); /* R */
- VEC4_MAX(quad->outputs.color[1], source[1], dest[1]); /* G */
- VEC4_MAX(quad->outputs.color[2], source[2], dest[2]); /* B */
- break;
- default:
- abort();
+ break;
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ assert(0); /* to do */
+ break;
+ case PIPE_BLENDFACTOR_SRC1_ALPHA:
+ assert(0); /* to do */
+ break;
+ case PIPE_BLENDFACTOR_ZERO:
+ VEC4_COPY(source[0], zero); /* R */
+ VEC4_COPY(source[1], zero); /* G */
+ VEC4_COPY(source[2], zero); /* B */
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ {
+ GLfloat inv_comp[4];
+ VEC4_SUB(inv_comp, one, quad->outputs.color[0]); /* R */
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_comp); /* R */
+ VEC4_SUB(inv_comp, one, quad->outputs.color[1]); /* G */
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_comp); /* G */
+ VEC4_SUB(inv_comp, one, quad->outputs.color[2]); /* B */
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_comp); /* B */
}
-
- /*
- * Combine A terms
- */
- switch (softpipe->blend.alpha_func) {
- case PIPE_BLEND_ADD:
- VEC4_ADD(quad->outputs.color[3], source[3], dest[3]); /* A */
- break;
- case PIPE_BLEND_SUBTRACT:
- VEC4_SUB(quad->outputs.color[3], source[3], dest[3]); /* A */
- break;
- case PIPE_BLEND_REVERSE_SUBTRACT:
- VEC4_SUB(quad->outputs.color[3], dest[3], source[3]); /* A */
- break;
- case PIPE_BLEND_MIN:
- VEC4_MIN(quad->outputs.color[3], source[3], dest[3]); /* A */
- break;
- case PIPE_BLEND_MAX:
- VEC4_MAX(quad->outputs.color[3], source[3], dest[3]); /* A */
- default:
- abort();
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+ {
+ GLfloat inv_alpha[4];
+ VEC4_SUB(inv_alpha, one, quad->outputs.color[3]);
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
}
-
- /* pass blended quad to next stage */
- qs->next->run(qs->next, quad);
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA:
+ {
+ GLfloat inv_alpha[4];
+ VEC4_SUB(inv_alpha, one, dest[3]);
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
+ }
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ {
+ GLfloat inv_comp[4];
+ VEC4_SUB(inv_comp, one, dest[0]); /* R */
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_comp); /* R */
+ VEC4_SUB(inv_comp, one, dest[1]); /* G */
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_comp); /* G */
+ VEC4_SUB(inv_comp, one, dest[2]); /* B */
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_comp); /* B */
+ }
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ {
+ GLfloat inv_comp[4];
+ /* R */
+ VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[0]);
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_comp);
+ /* G */
+ VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[1]);
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_comp);
+ /* B */
+ VEC4_SCALAR(inv_comp, 1.0 - softpipe->blend_color.color[2]);
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_comp);
+ }
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
+ {
+ GLfloat alpha[4], inv_alpha[4];
+ VEC4_SCALAR(alpha, 1.0 - softpipe->blend_color.color[3]);
+ VEC4_MUL(source[0], quad->outputs.color[0], inv_alpha); /* R */
+ VEC4_MUL(source[1], quad->outputs.color[1], inv_alpha); /* G */
+ VEC4_MUL(source[2], quad->outputs.color[2], inv_alpha); /* B */
+ }
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ assert(0); /* to do */
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
+ assert(0); /* to do */
+ break;
+ default:
+ abort();
+ }
+
+ /*
+ * Compute src/first term A
+ */
+ switch (softpipe->blend.alpha_src_factor) {
+ case PIPE_BLENDFACTOR_ONE:
+ VEC4_COPY(source[3], quad->outputs.color[3]); /* A */
+ break;
+ case PIPE_BLENDFACTOR_SRC_ALPHA:
+ {
+ const GLfloat *alpha = quad->outputs.color[3];
+ VEC4_MUL(source[3], quad->outputs.color[3], alpha); /* A */
+ }
+ break;
+ case PIPE_BLENDFACTOR_ZERO:
+ VEC4_COPY(source[3], zero); /* A */
+ break;
+ /* XXX fill in remaining terms */
+ default:
+ abort();
+ }
+
+
+ /*
+ * Compute dest/second term RGB
+ */
+ switch (softpipe->blend.rgb_dst_factor) {
+ case PIPE_BLENDFACTOR_ONE:
+ /* dest = dest * 1 NO-OP, leave dest as-is */
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+ {
+ GLfloat one_minus_alpha[QUAD_SIZE];
+ VEC4_SUB(one_minus_alpha, one, quad->outputs.color[3]);
+ VEC4_MUL(dest[0], dest[0], one_minus_alpha); /* R */
+ VEC4_MUL(dest[1], dest[1], one_minus_alpha); /* G */
+ VEC4_MUL(dest[2], dest[2], one_minus_alpha); /* B */
+ }
+ break;
+ case PIPE_BLENDFACTOR_ZERO:
+ VEC4_COPY(dest[0], zero); /* R */
+ VEC4_COPY(dest[1], zero); /* G */
+ VEC4_COPY(dest[2], zero); /* B */
+ break;
+ /* XXX fill in remaining terms */
+ default:
+ abort();
+ }
+
+ /*
+ * Compute dest/second term A
+ */
+ switch (softpipe->blend.alpha_dst_factor) {
+ case PIPE_BLENDFACTOR_ONE:
+ /* dest = dest * 1 NO-OP, leave dest as-is */
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+ {
+ GLfloat one_minus_alpha[QUAD_SIZE];
+ VEC4_SUB(one_minus_alpha, one, quad->outputs.color[3]);
+ VEC4_MUL(dest[3], dest[3], one_minus_alpha); /* A */
+ }
+ break;
+ case PIPE_BLENDFACTOR_ZERO:
+ VEC4_COPY(dest[3], zero); /* A */
+ break;
+ /* XXX fill in remaining terms */
+ default:
+ abort();
+ }
+
+ /*
+ * Combine RGB terms
+ */
+ switch (softpipe->blend.rgb_func) {
+ case PIPE_BLEND_ADD:
+ VEC4_ADD(quad->outputs.color[0], source[0], dest[0]); /* R */
+ VEC4_ADD(quad->outputs.color[1], source[1], dest[1]); /* G */
+ VEC4_ADD(quad->outputs.color[2], source[2], dest[2]); /* B */
+ break;
+ case PIPE_BLEND_SUBTRACT:
+ VEC4_SUB(quad->outputs.color[0], source[0], dest[0]); /* R */
+ VEC4_SUB(quad->outputs.color[1], source[1], dest[1]); /* G */
+ VEC4_SUB(quad->outputs.color[2], source[2], dest[2]); /* B */
+ break;
+ case PIPE_BLEND_REVERSE_SUBTRACT:
+ VEC4_SUB(quad->outputs.color[0], dest[0], source[0]); /* R */
+ VEC4_SUB(quad->outputs.color[1], dest[1], source[1]); /* G */
+ VEC4_SUB(quad->outputs.color[2], dest[2], source[2]); /* B */
+ break;
+ case PIPE_BLEND_MIN:
+ VEC4_MIN(quad->outputs.color[0], source[0], dest[0]); /* R */
+ VEC4_MIN(quad->outputs.color[1], source[1], dest[1]); /* G */
+ VEC4_MIN(quad->outputs.color[2], source[2], dest[2]); /* B */
+ break;
+ case PIPE_BLEND_MAX:
+ VEC4_MAX(quad->outputs.color[0], source[0], dest[0]); /* R */
+ VEC4_MAX(quad->outputs.color[1], source[1], dest[1]); /* G */
+ VEC4_MAX(quad->outputs.color[2], source[2], dest[2]); /* B */
+ break;
+ default:
+ abort();
}
+
+ /*
+ * Combine A terms
+ */
+ switch (softpipe->blend.alpha_func) {
+ case PIPE_BLEND_ADD:
+ VEC4_ADD(quad->outputs.color[3], source[3], dest[3]); /* A */
+ break;
+ case PIPE_BLEND_SUBTRACT:
+ VEC4_SUB(quad->outputs.color[3], source[3], dest[3]); /* A */
+ break;
+ case PIPE_BLEND_REVERSE_SUBTRACT:
+ VEC4_SUB(quad->outputs.color[3], dest[3], source[3]); /* A */
+ break;
+ case PIPE_BLEND_MIN:
+ VEC4_MIN(quad->outputs.color[3], source[3], dest[3]); /* A */
+ break;
+ case PIPE_BLEND_MAX:
+ VEC4_MAX(quad->outputs.color[3], source[3], dest[3]); /* A */
+ default:
+ abort();
+ }
+
+ /* pass blended quad to next stage */
+ qs->next->run(qs->next, quad);
}