--- /dev/null
+uniform Colors
+{
+ vec4 color;
+ float gray;
+};
+uniform sampler2D mask;
+uniform Transform
+{
+ mat4 mvp;
+} transform;
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec2 texcoord;
+void main()
+{
+ passthrough;
+ gl_Position = transform.mvp*position;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+void main()
+{
+ frag_color = texture(mask, texcoord).r > 0.5 ? color : gray;
+}
+
+/* Expected error:
+<test>:25: Ternary operator has incompatible types 'vec4' and 'float'
+*/