1df47db6ba
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.
12 lines
192 B
GLSL
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]);
|
|
}
|