summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-fs-vec4-indexing-7.shader_test
blob: ed691746c5b83c0157c54db1d42c1d72dd1c6ec5 (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
[require]
GL >= 2.0
GLSL >= 1.10

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

[fragment shader]
uniform vec4 val;
uniform int i;

vec4 chan_to_green(float x)
{
	if (x < 0.0)
		return vec4(0.0);
	return vec4(0.0, x, 0.0, 0.0);
}

void main()
{
	gl_FragColor = chan_to_green(vec4(0.0, 0.0, 1.0, 0.0)[i]);
}

[test]
uniform int i 2
draw rect -1 -1 2 2
probe rgb 1 1 0.0 1.0 0.0