1#version 310 es
2layout(binding = 1) uniform sampler2D s2D;
3layout(binding = 2) uniform lowp sampler3D s3D;
4layout(binding = 3) uniform samplerCube sCube;
5layout(binding = 4) uniform lowp samplerCubeShadow sCubeShadow;
6layout(binding = 5) uniform lowp sampler2DShadow s2DShadow;
7layout(binding = 6) uniform lowp sampler2DArray s2DArray;
8layout(binding = 7) uniform lowp sampler2DArrayShadow s2DArrayShadow;
9layout(binding = 8) uniform lowp isampler2D is2D;
10layout(binding = 9) uniform lowp isampler3D is3D;
11layout(binding = 10) uniform lowp isamplerCube isCube;
12layout(binding = 11) uniform lowp isampler2DArray is2DArray;
13layout(binding = 12) uniform lowp usampler2D us2D;
14layout(binding = 13) uniform lowp usampler3D us3D;
15layout(binding = 14) uniform lowp usamplerCube usCube;
16layout(binding = 15) uniform lowp usampler2DArray us2DArray;
17
18precision lowp float;
19layout(location = 4) in float c1D;
20layout(location = 5) in vec2  c2D;
21layout(location = 6) in vec3  c3D;
22layout(location = 7) in smooth vec4  c4D;
23
24layout(location = 1) flat in int   ic1D;
25layout(location = 2) flat in ivec3 ic3D;
26layout(location = 3) flat in ivec4 ic4D;
27
28const ivec2 ic2D = ivec2(2, 3);
29
30struct s {
31    int i;
32    sampler2D s;
33};
34
35struct S2 {
36    vec3 c;
37    float f;
38};
39
40layout(location = 8) in S2 s2;
41
42layout(location = 0) out vec3 sc;
43layout(location = 1) out float sf;
44
45layout(binding = 0) uniform sampler2D arrayedSampler[5];
46
47void main()
48{
49    float f;
50    vec4 v;
51    v = texture(s2D, c2D);
52    v = textureProj(s3D, c4D);
53    v = textureLod(s2DArray, c3D, 1.2);
54    v = texelFetch(s3D, ic3D, ic1D);
55    f = textureLodOffset(s2DShadow, c3D, c1D, ic2D);
56    v = textureProjLodOffset(s2D, c3D, c1D, ic2D);
57    v = textureGrad(sCube, c3D, c3D, c3D);
58    f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
59    v = textureProjGrad(s3D, c4D, c3D, c3D);
60    v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
61
62    ivec4 iv;
63    iv = texture(is2D, c2D);
64    iv = textureProjOffset(is2D, c4D, ic2D);
65    iv = textureProjLod(is2D, c3D, c1D);
66    iv = textureProjGrad(is2D, c3D, c2D, c2D);
67    iv = texture(is3D, c3D, 4.2);
68    iv = textureLod(isCube, c3D, c1D);
69    iv = texelFetch(is2DArray, ic3D, ic1D);
70
71    iv.xy = textureSize(sCubeShadow, 2);
72}
73
74void foo23()
75{
76    textureOffset(s2DShadow, c3D, ivec2(-8, 7), c1D);
77}
78