+ if (color0.file == BAD_FILE) {
+ /* Even if there's no color buffers enabled, we still need to send
+ * alpha out the pipeline to our null renderbuffer to support
+ * alpha-testing, alpha-to-coverage, and so on.
+ */
+ emit_color_write(this->outputs[0], 3, nr);
+ nr += 4 * reg_width;
+ } else if (color1.file == BAD_FILE) {
+ if (src0_alpha.file != BAD_FILE) {
+ fs_inst *inst;
+ inst = emit(MOV(fs_reg(MRF, nr, src0_alpha.type), src0_alpha));
+ inst->saturate = key->clamp_fragment_color;
+ nr += reg_width;
+ }
+
+ for (unsigned i = 0; i < components; i++)
+ emit_color_write(color0, i, nr);
+
+ nr += 4 * reg_width;
+ } else {
+ for (unsigned i = 0; i < components; i++)
+ emit_color_write(color0, i, nr);
+ nr += 4 * reg_width;
+
+ for (unsigned i = 0; i < components; i++)
+ emit_color_write(color1, i, nr);
+ nr += 4 * reg_width;
+ }