summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-ir-glsl-legalize.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp
index 5a14fe1aa..0a61d792d 100644
--- a/source/slang/slang-ir-glsl-legalize.cpp
+++ b/source/slang/slang-ir-glsl-legalize.cpp
@@ -575,6 +575,17 @@ GLSLSystemValueInfo* getGLSLSystemValueInfo(
// globalVarExpr = createGLSLBuiltinRef("gl_ViewportMaskPerViewNV",
// getUnsizedArrayType(getIntType()));
}
+ else if (semanticName == "sv_barycentrics")
+ {
+ context->requireGLSLVersion(ProfileVersion::GLSL_450);
+ context->requireGLSLExtension(UnownedStringSlice::fromLiteral("GL_NV_fragment_shader_barycentric"));
+
+ name = "gl_BaryCoordNV";
+
+ // TODO: There is also the `gl_BaryCoordNoPerspNV` builtin, which
+ // we ought to use if the `noperspective` modifier has been
+ // applied to this varying input.
+ }
if( name )
{