+
+ // If we're the last phase, add the right #defines for Y'CbCr multi-output as needed.
+ if (phase->output_node->outgoing_links.empty() && output_color_ycbcr) {
+ switch (output_ycbcr_splitting) {
+ case YCBCR_OUTPUT_INTERLEAVED:
+ // No #defines set.
+ break;
+ case YCBCR_OUTPUT_SPLIT_Y_AND_CBCR:
+ frag_shader += "#define YCBCR_OUTPUT_SPLIT_Y_AND_CBCR 1\n";
+ break;
+ case YCBCR_OUTPUT_PLANAR:
+ frag_shader += "#define YCBCR_OUTPUT_PLANAR 1\n";
+ break;
+ default:
+ assert(false);
+ }
+
+ if (output_color_rgba) {
+ // Note: Needs to come in the header, because not only the
+ // output needs to see it (YCbCrConversionEffect and DitherEffect
+ // do, too).
+ frag_shader_header += "#define YCBCR_ALSO_OUTPUT_RGBA 1\n";
+ }
+ }
+ frag_shader.append(read_file("footer.frag"));