From 2765861cdc104e6104a31cf9e20800b8d1dfae26 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 8 Mar 2021 13:05:56 -0800 Subject: Add GLSL support for SV_InnerCoverage (#1740) This was a fairly straightforward addition once I found the correct GLSL extension spec to use. --- source/slang/slang-ir-glsl-legalize.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source') diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp index ae6521076..052b4fb29 100644 --- a/source/slang/slang-ir-glsl-legalize.cpp +++ b/source/slang/slang-ir-glsl-legalize.cpp @@ -324,6 +324,16 @@ GLSLSystemValueInfo* getGLSLSystemValueInfo( name = "gl_SampleMask[0]"; } } + else if(semanticName == "sv_innercoverage") + { + // uint in hlsl, bool in glsl + // https://www.khronos.org/registry/OpenGL/extensions/NV/NV_conservative_raster_underestimation.txt + + context->requireGLSLExtension(UnownedStringSlice::fromLiteral("GL_NV_conservative_raster_underestimation")); + + name = "gl_FragFullyCoveredNV"; + requiredType = builder->getBasicType(BaseType::Bool); + } else if(semanticName == "sv_depth") { // Float in hlsl & glsl -- cgit v1.2.3