summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-inout-struct-02.shader_test
blob: da33fe515925ecc47781afdc0a22af82dbb4c9c7 (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
32
33
34
/* Test struct inout parameter. */

[require]
GLSL >= 1.10

[vertex shader]

void main()
{
	gl_Position = ftransform();
}

[fragment shader]

struct s {
	float f;
};

void myfunc(inout s s1)
{
	s1.f = s1.f + 0.1;
}

void main()
{
	s s1;
	s1.f = 0.9;
	myfunc(s1);
	gl_FragColor = vec4(0.0, s1.f, 0.0, 1.0);
}

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