• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 450
2
3uniform layout(binding=0) sampler       g_sSamp1;
4uniform sampler       g_sSamp2;
5uniform layout(binding=2) sampler       g_sSamp3[2];
6uniform sampler       g_sSamp4[3];
7uniform sampler       g_sSamp5;
8
9uniform sampler       g_sSamp_unused1;
10uniform sampler       g_sSamp_unused2;
11
12uniform layout(binding=1) texture1D          g_tTex1;
13uniform texture1D  g_tTex2;
14uniform layout(binding=3) texture1D          g_tTex3[2];
15uniform texture1D          g_tTex4[3];
16uniform texture1D          g_tTex5;
17
18uniform layout(binding=0)  texture1D          g_tTex_unused1;
19uniform layout(binding=2)  texture1D          g_tTex_unused2;
20uniform texture1D          g_tTex_unused3;
21
22struct MyStruct_t {
23    int a;
24    float b;
25    vec3 c;
26};
27
28uniform layout(binding=4) myblock {
29    MyStruct_t mystruct;
30    vec4 myvec4_a;
31    vec4 myvec4_b;
32    ivec4 myint4_a;
33};
34
35vec4 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
48vec4 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:
56vec4 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
63out vec4 FragColor;
64
65void main()
66{
67    FragColor = Func1() + Func2();
68}
69