1cb93a386Sopenharmony_ci#version 310 es
2cb93a386Sopenharmony_ciprecision mediump float;
3cb93a386Sopenharmony_ci
4cb93a386Sopenharmony_cilayout(set = 0, binding = 0) uniform mediump sampler uSampler;
5cb93a386Sopenharmony_cilayout(set = 0, binding = 1) uniform mediump texture2D uTexture[4];
6cb93a386Sopenharmony_cilayout(set = 0, binding = 2) uniform mediump texture3D uTexture3D[4];
7cb93a386Sopenharmony_cilayout(set = 0, binding = 3) uniform mediump textureCube uTextureCube[4];
8cb93a386Sopenharmony_cilayout(set = 0, binding = 4) uniform mediump texture2DArray uTextureArray[4];
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_cilayout(location = 0) out vec4 FragColor;
11cb93a386Sopenharmony_cilayout(location = 0) in vec2 vTex;
12cb93a386Sopenharmony_cilayout(location = 1) in vec3 vTex3;
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_civec4 sample_func(mediump sampler samp, vec2 uv)
15cb93a386Sopenharmony_ci{
16cb93a386Sopenharmony_ci    return texture(sampler2D(uTexture[2], samp), uv);
17cb93a386Sopenharmony_ci}
18cb93a386Sopenharmony_ci
19cb93a386Sopenharmony_civec4 sample_func_dual(mediump sampler samp, mediump texture2D tex, vec2 uv)
20cb93a386Sopenharmony_ci{
21cb93a386Sopenharmony_ci    return texture(sampler2D(tex, samp), uv);
22cb93a386Sopenharmony_ci}
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_civec4 sample_func_dual_array(mediump sampler samp, mediump texture2D tex[4], vec2 uv)
25cb93a386Sopenharmony_ci{
26cb93a386Sopenharmony_ci    return texture(sampler2D(tex[1], samp), uv);
27cb93a386Sopenharmony_ci}
28cb93a386Sopenharmony_ci
29cb93a386Sopenharmony_civoid main()
30cb93a386Sopenharmony_ci{
31cb93a386Sopenharmony_ci    vec2 off = 1.0 / vec2(textureSize(sampler2D(uTexture[1], uSampler), 0));
32cb93a386Sopenharmony_ci    vec2 off2 = 1.0 / vec2(textureSize(sampler2D(uTexture[2], uSampler), 1));
33cb93a386Sopenharmony_ci
34cb93a386Sopenharmony_ci    vec4 c0 = sample_func(uSampler, vTex + off + off2);
35cb93a386Sopenharmony_ci    vec4 c1 = sample_func_dual(uSampler, uTexture[1], vTex + off + off2);
36cb93a386Sopenharmony_ci    vec4 c2 = sample_func_dual_array(uSampler, uTexture, vTex + off + off2);
37cb93a386Sopenharmony_ci    vec4 c3 = texture(sampler2DArray(uTextureArray[3], uSampler), vTex3);
38cb93a386Sopenharmony_ci    vec4 c4 = texture(samplerCube(uTextureCube[1], uSampler), vTex3);
39cb93a386Sopenharmony_ci    vec4 c5 = texture(sampler3D(uTexture3D[2], uSampler), vTex3);
40cb93a386Sopenharmony_ci
41cb93a386Sopenharmony_ci    FragColor = c0 + c1 + c2 + c3 + c4 + c5;
42cb93a386Sopenharmony_ci}
43