summaryrefslogtreecommitdiffstats
path: root/source/compiler-core
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler-core')
-rw-r--r--source/compiler-core/slang-spirv-core-grammar.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/compiler-core/slang-spirv-core-grammar.cpp b/source/compiler-core/slang-spirv-core-grammar.cpp
index 8b5e79071..5f8043e65 100644
--- a/source/compiler-core/slang-spirv-core-grammar.cpp
+++ b/source/compiler-core/slang-spirv-core-grammar.cpp
@@ -44,6 +44,7 @@ struct Instruction
UnownedStringSlice class_;
SpvWord opcode;
List<UnownedStringSlice> capabilities;
+ List<UnownedStringSlice> aliases;
List<Operand> operands;
};
SLANG_MAKE_STRUCT_RTTI_INFO(
@@ -52,6 +53,7 @@ SLANG_MAKE_STRUCT_RTTI_INFO(
SLANG_RTTI_FIELD_IMPL(class_, "class", 0),
SLANG_RTTI_FIELD(opcode),
SLANG_OPTIONAL_RTTI_FIELD(capabilities),
+ SLANG_OPTIONAL_RTTI_FIELD(aliases),
SLANG_OPTIONAL_RTTI_FIELD(operands));
struct Enumerant
@@ -223,6 +225,11 @@ RefPtr<SPIRVCoreGrammarInfo> SPIRVCoreGrammarInfo::loadFromJSON(
{
res->opcodes.dict.add(i.opname, SpvOp(i.opcode));
+ for (auto alias : i.aliases)
+ {
+ res->opcodes.dict.add(alias, SpvOp(i.opcode));
+ }
+
const auto class_ = i.class_ == "Type-Declaration" ? OpInfo::TypeDeclaration
: i.class_ == "Constant-Creation" ? OpInfo::ConstantCreation
: i.class_ == "Debug" ? OpInfo::Debug