Merge pull request #3031 from rg3igalia/sub-group-size-arb-flat-fix
[platform/upstream/glslang.git] / Test / spv.glsl.register.autoassign.frag
1 #version 450
2
3 uniform layout(binding=0) sampler       g_sSamp1;
4 uniform sampler       g_sSamp2;
5 uniform layout(binding=2) sampler       g_sSamp3[2];
6 uniform sampler       g_sSamp4[3];
7 uniform sampler       g_sSamp5;
8
9 uniform sampler       g_sSamp_unused1;
10 uniform sampler       g_sSamp_unused2;
11
12 uniform layout(binding=1) texture1D          g_tTex1;
13 uniform texture1D  g_tTex2;
14 uniform layout(binding=3) texture1D          g_tTex3[2];
15 uniform texture1D          g_tTex4[3];
16 uniform texture1D          g_tTex5;
17
18 uniform layout(binding=0)  texture1D          g_tTex_unused1;
19 uniform layout(binding=2)  texture1D          g_tTex_unused2;
20 uniform texture1D          g_tTex_unused3;
21
22 struct MyStruct_t {
23     int a;
24     float b;
25     vec3 c;
26 };
27
28 uniform layout(binding=4) myblock {
29     MyStruct_t mystruct;
30     vec4 myvec4_a;
31     vec4 myvec4_b;
32     ivec4 myint4_a;
33 };
34
35 vec4 Func1()
36 {
37     return
38         texture(sampler1D(g_tTex1, g_sSamp1), 0.1) +
39         texture(sampler1D(g_tTex2, g_sSamp2), 0.2) +
40         texture(sampler1D(g_tTex3[0], g_sSamp3[0]), 0.3) +
41         texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3) +
42         texture(sampler1D(g_tTex4[1], g_sSamp4[1]), 0.4) +
43         texture(sampler1D(g_tTex4[2], g_sSamp4[2]), 0.4) +
44         texture(sampler1D(g_tTex5, g_sSamp5), 0.5) +
45         mystruct.c[1];
46 }
47
48 vec4 Func2()
49 {
50     return
51         texture(sampler1D(g_tTex1, g_sSamp1), 0.1) +
52         texture(sampler1D(g_tTex3[1], g_sSamp3[1]), 0.3);
53 }
54
55 // Not called from entry point:
56 vec4 Func2_unused()
57 {
58     return
59         texture(sampler1D(g_tTex_unused1, g_sSamp_unused1), 1.1) +
60         texture(sampler1D(g_tTex_unused2, g_sSamp_unused2), 1.2);
61 }
62
63 out vec4 FragColor;
64
65 void main()
66 {
67     FragColor = Func1() + Func2();
68 }