xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/spv.sampledImageBlock.frag (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#version 450
2
3layout(set = 0, binding = 0) uniform texture2D tex0;
4layout(set = 0, binding = 1) uniform sampler samp0;
5layout(set = 0, binding = 2) uniform ParamBuffer {
6    int cond;
7} paramBuffer;
8
9layout(location = 0) out vec4 fragColor;
10layout(location = 0) in flat ivec2 texCoord;
11
12void main() {
13    // get input
14
15    const vec4 texel = texelFetch(sampler2D(tex0, samp0),
16            paramBuffer.cond == 0 ? texCoord.xy : texCoord.yx,
17            0);
18
19    fragColor = vec4(texel.xyz, 1.0);
20
21}
22