aboutsummaryrefslogtreecommitdiffstats
path: root/src/runtimerender/res/rhishaders/ssaaresolve.frag
blob: 3860e71ecd497a4fd55c5b04a837a36dda6f0387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#version 440

layout(location = 0) out vec4 fragOutput;

layout(location = 0) in vec2 uv_coord;
#if QSHADER_VIEW_COUNT >= 2
layout(location = 1) flat in uint v_viewIndex;
#endif

#if QSHADER_VIEW_COUNT >= 2
layout(binding = 0) uniform sampler2DArray tex;
#else
layout(binding = 0) uniform sampler2D tex;
#endif

void main()
{
#if QSHADER_HLSL || QSHADER_MSL
    vec2 uv = vec2(uv_coord.x, 1.0 - uv_coord.y);
#if QSHADER_VIEW_COUNT >= 2
    fragOutput = texture(tex, vec3(uv, v_viewIndex));
#else
    fragOutput = texture(tex, uv);
#endif
#else
#if QSHADER_VIEW_COUNT >= 2
    fragOutput = texture(tex, vec3(uv_coord, v_viewIndex));
#else
    fragOutput = texture(tex, uv_coord);
#endif
#endif
}