summaryrefslogtreecommitdiff
path: root/source/slang/modifier-defs.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-12 14:21:52 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-12 14:21:52 -0700
commit02f77bbf12981abe376b2d5987684224a50ae4b2 (patch)
tree156c36903426a4f18f0e4c857d9d9eb987459789 /source/slang/modifier-defs.h
parentd43ee03c6101ce76331135cebdc57711cb3a2020 (diff)
Add ability for intrinsics to require GLSL extensions
When cross-compiling, we need to detect when an intrinsic is used that required non-default GLSL capabilities and emit an appropriate `#extension ... : require` line. I'm handling this by attaching a custom modifier to declarations that require an extension in order to be callable.
Diffstat (limited to 'source/slang/modifier-defs.h')
-rw-r--r--source/slang/modifier-defs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/modifier-defs.h b/source/slang/modifier-defs.h
index 2b5c77d86..9806a12a5 100644
--- a/source/slang/modifier-defs.h
+++ b/source/slang/modifier-defs.h
@@ -53,6 +53,12 @@ SYNTAX_CLASS(TargetIntrinsicModifier, IntrinsicModifierBase)
FIELD(Token, definitionToken)
END_SYNTAX_CLASS()
+// A modifier to tag something as an intrinsic that requires
+// a certain GLSL extension to be enabled when used
+SYNTAX_CLASS(RequiredGLSLExtensionModifier, Modifier)
+ FIELD(Token, extensionNameToken)
+END_SYNTAX_CLASS()
+
SIMPLE_SYNTAX_CLASS(InOutModifier, OutModifier)
// This is a special sentinel modifier that gets added