diff options
Diffstat (limited to 'source/slang/slang-parser.cpp')
| -rw-r--r-- | source/slang/slang-parser.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index f2aff32ea..7ce710469 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -7221,6 +7221,23 @@ namespace Slang break; } } + + if (ret.opcode.flavor == SPIRVAsmOperand::Flavor::NamedValue + && ret.opcode.knownValue == SpvOp(0xffffffff)) + { + if (ret.opcode.token.type == TokenType::IntegerLiteral) + { + Int intVal = -1; + StringUtil::parseInt(ret.opcode.token.getContent(), intVal); + ret.opcode.knownValue = (SpvWord)intVal; + } + else + { + parser->diagnose(ret.opcode.token, Diagnostics::unrecognizedSPIRVOpcode, ret.opcode.token); + return std::nullopt; + } + } + return ret; } |
