summaryrefslogtreecommitdiffstats
path: root/tests/glsl/interface-block.glsl
blob: 8378de7bf11dc60b2b0cce42ea267bdeb548fa4b (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
//TEST:SIMPLE(filecheck=CHECK_GLSL): -target glsl -stage fragment -entry fragmentMain -allow-glsl

//CHECK_GLSL: layout(location = 0)
//CHECK_GLSL: out vec4 entryPointParam_fragmentMain_cd_out1_0;

//CHECK_GLSL: layout(location = 1)
//CHECK_GLSL: out vec4 entryPointParam_fragmentMain_cd_out2_0;

//CHECK_GLSL: layout(location = 0)
//CHECK_GLSL: in vec2 vd_texcoord_0_0;

//CHECK_GLSL: layout(location = 1)
//CHECK_GLSL: in vec2 vd_texcoord_1_0;

//CHECK_GLSL: layout(location = 2)
//CHECK_GLSL: in vec4 vd_inner_texcoord_2_0;

import glsl;

#version 400

struct innerData
{
    vec4 texcoord_2;
};

in VertexData
{
    vec2 texcoord_0;
    vec2 texcoord_1;
    innerData inner;
} vd;

out ColorData
{
    vec4 out1;
    vec4 out2;
} cd;

void fragmentMain()
{
    cd.out1 = vec4(vd.texcoord_0, vd.texcoord_1.x, vd.inner.texcoord_2.y);
    cd.out2 = vec4(vd.texcoord_1, vd.texcoord_0.x, vd.inner.texcoord_2.y);
}