summaryrefslogtreecommitdiff
path: root/tests/shaders/loopfunc.shader_test
blob: f37f4eaa1dca530954ce15d41c446becfbff27a0 (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]
bool myFunc(void)
{
	int i;
	for(i = 0; i < 2; i++)
	{
		if(i < 1)
			return true;
 		else
			return false;
	}
}

void main(void)
{
	if (myFunc())
		gl_FrontColor = vec4(0.0, 1.0, 0.0, 1.0); // green
	else
		gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0); // red

	gl_Position = gl_Vertex;
}

[test]
draw rect -1 -1 2 2
probe all rgba 0.0 1.0 0.0 1.0