summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-struct-constructor-01.shader_test
blob: e40e81d199aad315376b1be81f815c27be287120 (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
/* Test an unary struct constructor. */

[require]
GLSL >= 1.10


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

[fragment shader]
struct s {
	float f;
};

void main()
{
	s s1 = s(0.5);
    if (s1.f == 0.5)
        gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
    else
        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}

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