SPIRV-Cross-Vulnerable/shaders-msl/frag/post-depth-coverage.ios.msl2.frag
Chip Davis 1df47db6ba Support the SPV_KHR_post_depth_coverage extension.
Using the `PostDepthCoverage` mode specifies that the `gl_SampleMaskIn`
variable is to contain the computed coverage mask following the early
fragment tests, which this mode requires and implicitly enables.

Note that unlike Vulkan and OpenGL, Metal places this on the sample mask
input itself, and furthermore does *not* implicitly enable early
fragment testing. If it isn't enabled explicitly with an
`[[early_fragment_tests]]` attribute, the compiler will error out. So we
have to enable that mode explicitly if `PostDepthCoverage` is enabled
but `EarlyFragmentTests` isn't.

For Metal, only iOS supports this; for some reason, Apple has yet to
implement it on macOS, even though many desktop cards support it.
2019-07-11 10:28:43 -05:00

12 lines
192 B
GLSL

#version 450
#extension GL_ARB_post_depth_coverage : require
layout(post_depth_coverage) in;
layout(location = 0) out vec4 FragColor;
void main()
{
FragColor = vec4(gl_SampleMaskIn[0]);
}