summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-11 00:01:12 -0700
committerGitHub <noreply@github.com>2024-06-11 00:01:12 -0700
commit6d5ef9b650a9db35f7774ca09d9225d0c30849e4 (patch)
treed8f812a52d937709efa23b17c1e36c51ee1b66f4 /source/slang/slang-emit-glsl.cpp
parent21bbebb19dfdbbee107b9fd9830e18d5fb6a573a (diff)
Fix `GetAttributeAtVertex` for spirv and glsl targets. (#4334)
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index d13bc96d1..936dc15ff 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -2755,6 +2755,11 @@ void GLSLSourceEmitter::emitVarDecorationsImpl(IRInst* varDecl)
{
prefix = toSlice("hitAttribute");
}
+ else if (as<IRPerVertexDecoration>(decoration))
+ {
+ _requireGLSLExtension(toSlice("GL_EXT_fragment_shader_barycentric"));
+ prefix = toSlice("pervertex");
+ }
else
{
IRIntegerValue locationValue = -1;