[require] GLSL >= 1.40 [vertex shader] layout(std140) uniform UB1 { bool b1; }; flat out int vertex_pass; in vec4 piglit_vertex; void main() { if (b1) vertex_pass = 0; else vertex_pass = 1; gl_Position = piglit_vertex; } [fragment shader] precision highp float; out vec4 piglit_fragcolor; flat in int vertex_pass; void main() { piglit_fragcolor = bool(vertex_pass) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); } [test] uniform int b1 0 draw rect -1 -1 2 2 probe all rgba 0.0 1.0 0.0 1.0