summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-fs-functions-6.shader_test
blob: c6a2f22d8930e09001b5bd86cc9c3e7711bffce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[require]
GL >= 2.0
GLSL >= 1.10

[vertex shader]
void main()
{
	gl_Position = gl_Vertex;
}

[fragment shader]
float val = 0.0;
void sub() {
	for (int i = 0; i < 3; ++i) {
		for (int j = 0; j < 3; ++j) {
			if (i == 1 && j == 1)
				return;
			val = 0.5;
		}
	}
	val = 1.0;
}

void main() {
	sub();
	gl_FragColor = vec4(val);
}

[test]
draw rect -1 -1 2 2
probe all rgb 0.5 0.5 0.5 0.5