#version 450 // Compiled twice by the ShaderCompile test: once as is, once with VARIANT_RED // and VARIANT_ALPHA=0.5 defined. The red branch does not compile unless the // NAME=VALUE define arrives, and the two outputs only differ if the bare one // does. layout(location = 0) out vec4 outColor; void main() { #ifdef VARIANT_RED outColor = vec4(1.0, 0.0, 0.0, VARIANT_ALPHA); #else outColor = vec4(0.0, 1.0, 0.0, 1.0); #endif }