xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/link.crossStageOptimization.vert (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#version 440
2
3layout(std140) uniform AccessedUniformBlock
4{
5    vec4 a;
6    vec4 b;
7};
8
9layout(std140) uniform NotAccessedUniformBlock
10{
11    vec4 c;
12    vec4 d;
13};
14
15layout(std430) buffer AccessedStorageBlock
16{
17    float e[512];
18};
19
20layout(std430) buffer NotAccessedStorageBlock
21{
22    float f[512];
23};
24
25uniform sampler2D uSampler0; // accessed
26uniform sampler2D uSampler1; // not accessed
27
28layout(location = 0) out vec4 a0; // accessed
29layout(location = 1) out vec4 a1; // not accessed
30layout(location = 2) out vec4 a2; // accessed
31layout(location = 3) out vec4 a3; // not accessed
32
33void main()
34{
35    a0 = a + vec4(e[0]) + texture(uSampler0, vec2(0.5, 0.5));
36    a1 = c + vec4(f[1]) + texture(uSampler1, vec2(0.5, 0.5));
37    a2 = b + vec4(e[0]) + texture(uSampler0, vec2(0.5, 0.5));
38    a3 = d + vec4(f[1]) + texture(uSampler1, vec2(0.5, 0.5));
39
40    gl_Position = vec4(1.0, 1.0, 1.0, 1.0);
41}
42