mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-09 22:00:05 +00:00
GLSL: Implement gl_FragFullyCoveredNV.
This commit is contained in:
parent
3cb8e7c223
commit
3fd148450a
14
reference/shaders-no-opt/frag/frag-fully-covered.frag
Normal file
14
reference/shaders-no-opt/frag/frag-fully-covered.frag
Normal file
@ -0,0 +1,14 @@
|
||||
#version 450
|
||||
#extension GL_NV_conservative_raster_underestimation : require
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!gl_FragFullyCoveredNV)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
FragColor = vec4(1.0);
|
||||
}
|
||||
|
11
shaders-no-opt/frag/frag-fully-covered.frag
Normal file
11
shaders-no-opt/frag/frag-fully-covered.frag
Normal file
@ -0,0 +1,11 @@
|
||||
#version 450
|
||||
#extension GL_NV_conservative_raster_underestimation : require
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (!gl_FragFullyCoveredNV)
|
||||
discard;
|
||||
FragColor = vec4(1.0);
|
||||
}
|
@ -8323,6 +8323,13 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
|
||||
require_extension_internal("GL_EXT_device_group");
|
||||
return "gl_DeviceIndex";
|
||||
|
||||
case BuiltInFullyCoveredEXT:
|
||||
if (!options.es)
|
||||
require_extension_internal("GL_NV_conservative_raster_underestimation");
|
||||
else
|
||||
SPIRV_CROSS_THROW("Need desktop GL to use GL_NV_conservative_raster_underestimation.");
|
||||
return "gl_FragFullyCoveredNV";
|
||||
|
||||
default:
|
||||
return join("gl_BuiltIn_", convert_to_string(builtin));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user