summaryrefslogtreecommitdiffstats
path: root/tests/rewriter/varying-struct.vert
blob: aae26a6ed5de13a09ca819ad766d3d4ae8ca059a (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#version 450 core
//TEST_DISABLED:COMPARE_GLSL:

#if defined(__SLANG__)

__import varying_struct;

VS_OUT main(VS_IN foo)
{
    return doIt(foo);
}

#else

struct VS_IN
{
	vec4 x;
	vec4 y;	
};

struct VS_OUT
{
	vec4 color;
	vec4 posH;
};

VS_OUT doIt(VS_IN i)
{
	VS_OUT o;
	o.color = i.x;
	o.posH = i.y;
	return o;
}

layout(location = 0)
out vec4 SLANG_out_bar_color;

layout(location = 0)
in vec4 SLANG_in_foo_x;

layout(location = 1)
in vec4 SLANG_in_foo_y;

void main()
{
	VS_OUT SLANG_tmp_0 = doIt(VS_IN(SLANG_in_foo_x, SLANG_in_foo_y));
	SLANG_out_bar_color = SLANG_tmp_0.color;
	gl_Position = SLANG_tmp_0.posH;
}

#endif