diff options
| author | Yong He <yonghe@outlook.com> | 2024-01-31 23:53:28 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-01 15:53:28 +0800 |
| commit | a2d2018a8be41aecd2c1810db8556e0c07595fb9 (patch) | |
| tree | 747494c7c56cc50a47eca57dbcc200ebf6280b36 /source/slang/slang-check-modifier.cpp | |
| parent | 2d0912bfe2de7799b32e80722fa5c8dc279a339b (diff) | |
Add slangc option to specialize entrypoint + auto glsl mode. (#3531)
* Add slangc option to specialize entrypoint.
* Auto enable glsl mode when input file has glsl extension name.
* Fix test.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
| -rw-r--r-- | source/slang/slang-check-modifier.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index 96ec0acc8..1a7f64944 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -1125,7 +1125,11 @@ namespace Slang if (auto decl = as<Decl>(syntaxNode)) { - if (!isModifierAllowedOnDecl(getLinkage()->getAllowGLSLInput(), m->astNodeType, decl)) + auto moduleDecl = getModuleDecl(decl); + bool isGLSLInput = getLinkage()->getAllowGLSLInput(); + if (!isGLSLInput && moduleDecl && moduleDecl->findModifier<GLSLModuleModifier>()) + isGLSLInput = true; + if (!isModifierAllowedOnDecl(isGLSLInput, m->astNodeType, decl)) { getSink()->diagnose(m, Diagnostics::modifierNotAllowed, m); return m; |
