summaryrefslogtreecommitdiffstats
path: root/source/slang/compiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/compiler.cpp')
-rw-r--r--source/slang/compiler.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp
index 9c1823f91..7a5501a23 100644
--- a/source/slang/compiler.cpp
+++ b/source/slang/compiler.cpp
@@ -137,6 +137,35 @@ namespace Slang
return Profile::Unknown;
}
+ Stage findStageByName(String const& name)
+ {
+ static const struct
+ {
+ char const* name;
+ Stage stage;
+ } kStages[] =
+ {
+ #define PROFILE_STAGE(ID, NAME, ENUM) \
+ { #NAME, Stage::ID },
+
+ #define PROFILE_STAGE_ALIAS(ID, NAME, VAL) \
+ { #NAME, Stage::ID },
+
+ #include "profile-defs.h"
+ };
+
+ for(auto entry : kStages)
+ {
+ if(name == entry.name)
+ {
+ return entry.stage;
+ }
+ }
+
+ return Stage::Unknown;
+ }
+
+
//
String emitHLSLForEntryPoint(