File: spv.sampledImageBlock.frag

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (21 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#version 450

layout(set = 0, binding = 0) uniform texture2D tex0;
layout(set = 0, binding = 1) uniform sampler samp0;
layout(set = 0, binding = 2) uniform ParamBuffer {
    int cond;
} paramBuffer;

layout(location = 0) out vec4 fragColor;
layout(location = 0) in flat ivec2 texCoord;

void main() {
    // get input

    const vec4 texel = texelFetch(sampler2D(tex0, samp0),
            paramBuffer.cond == 0 ? texCoord.xy : texCoord.yx,
            0);

    fragColor = vec4(texel.xyz, 1.0);

}