blob: b9e8ab05961de9bd43ea33a517d02a5979a75313 [file] [log] [blame]
amhagan05506bb2017-06-13 16:53:02 -04001#version 450 core
2
3#extension GL_AMD_shader_fragment_mask: enable
4
5layout(binding = 0) uniform sampler2DMS s2DMS;
6layout(binding = 1) uniform isampler2DMSArray is2DMSArray;
7
8layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS;
9
10layout(location = 0) out vec4 fragColor;
11
12void main()
13{
14 vec4 f4 = vec4(0.0);
15
16 uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3));
17 uint fragIndex = (fragMask & 0xF0) >> 4;
18 f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1);
19
20 fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1));
21 fragIndex = (fragMask & 0xF0) >> 4;
22 f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex);
23
24 fragMask = fragmentMaskFetchAMD(usubpassMS);
25 fragIndex = (fragMask & 0xF0) >> 4;
26 f4 += fragmentFetchAMD(usubpassMS, fragIndex);
27
28 fragColor = f4;
29}