Merge pull request #1137 from cdavis5e/post-depth-coverage-essl
GLSL: Fix post-depth coverage for ESSL.
This commit is contained in:
commit
761d3da677
14
reference/opt/shaders/frag/post-depth-coverage-es.frag
Normal file
14
reference/opt/shaders/frag/post-depth-coverage-es.frag
Normal file
@ -0,0 +1,14 @@
|
||||
#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]));
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
#version 450
|
||||
#if defined(GL_ARB_post_depth_coverge)
|
||||
#extension GL_ARB_post_depth_coverage : require
|
||||
#else
|
||||
#extension GL_EXT_post_depth_coverage : require
|
||||
#endif
|
||||
layout(early_fragment_tests, post_depth_coverage) in;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
14
reference/shaders/frag/post-depth-coverage-es.frag
Normal file
14
reference/shaders/frag/post-depth-coverage-es.frag
Normal file
@ -0,0 +1,14 @@
|
||||
#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]));
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
#version 450
|
||||
#if defined(GL_ARB_post_depth_coverge)
|
||||
#extension GL_ARB_post_depth_coverage : require
|
||||
#else
|
||||
#extension GL_EXT_post_depth_coverage : require
|
||||
#endif
|
||||
layout(early_fragment_tests, post_depth_coverage) in;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
13
shaders/frag/post-depth-coverage-es.frag
Normal file
13
shaders/frag/post-depth-coverage-es.frag
Normal file
@ -0,0 +1,13 @@
|
||||
#version 310 es
|
||||
#extension GL_EXT_post_depth_coverage : require
|
||||
#extension GL_OES_sample_variables : require
|
||||
precision mediump float;
|
||||
|
||||
layout(early_fragment_tests, post_depth_coverage) in;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(gl_SampleMaskIn[0]);
|
||||
}
|
@ -640,6 +640,19 @@ void CompilerGLSL::emit_header()
|
||||
statement("#endif");
|
||||
}
|
||||
}
|
||||
else if (ext == "GL_ARB_post_depth_coverage")
|
||||
{
|
||||
if (options.es)
|
||||
statement("#extension GL_EXT_post_depth_coverage : require");
|
||||
else
|
||||
{
|
||||
statement("#if defined(GL_ARB_post_depth_coverge)");
|
||||
statement("#extension GL_ARB_post_depth_coverage : require");
|
||||
statement("#else");
|
||||
statement("#extension GL_EXT_post_depth_coverage : require");
|
||||
statement("#endif");
|
||||
}
|
||||
}
|
||||
else
|
||||
statement("#extension ", ext, " : require");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user