Debian Codegraph @

tests/manual/rhi/shared/texture_arr.frag

raw
1 #version 440
2
3 layout(location = 0) in vec2 v_texcoord;
4
5 layout(location = 0) out vec4 fragColor;
6
7 layout(std140, binding = 0) uniform buf {
8 mat4 mvp;
9 int flip;
10 int array_index;
11 };
12
13 layout(binding = 1) uniform sampler2DArray texArr;
14
15 void main()
16 {
17 vec4 c = texture(texArr, vec3(v_texcoord, float(array_index)));
18 fragColor = vec4(c.rgb * c.a, c.a);
19 }