SPIRV-Cross/reference/opt/shaders/frag/post-depth-coverage-es.frag
Chip Davis 5fe1ecc324 GLSL: Fix post-depth coverage for ESSL.
ESSL does not support `GL_ARB_post_depth_coverage`. There, we must use
`GL_EXT_post_depth_coverage`. I've added this as a fallback for desktop
as well.

Note that `GL_EXT_post_depth_coverage` also requires the fragment shader
to set `early_fragment_tests` explicitly, while
`GL_ARB_post_depth_coverage` does not. It doesn't really matter either
way, since `SPV_KHR_post_depth_coverage` *also* requires both execution
modes to be explicitly set.
2019-08-28 13:40:13 -05:00

15 lines
318 B
GLSL

#version 310 es
#extension GL_EXT_post_depth_coverage : require
#extension GL_OES_sample_variables : require
precision mediump float;
precision highp int;
layout(early_fragment_tests, post_depth_coverage) in;
layout(location = 0) out vec4 FragColor;
void main()
{
FragColor = vec4(float(gl_SampleMaskIn[0]));
}