diff options
| author | Yong He <yonghe@outlook.com> | 2024-08-30 12:03:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-30 12:03:23 -0700 |
| commit | de83628070614ec37349c9f334ed72a54a6889da (patch) | |
| tree | bc97f74013a073fc958b75e68089696e14d71412 /source/slang/slang-parser.cpp | |
| parent | f428a058ea48535a323c32d206ebc7e551c3c3e9 (diff) | |
Support specialization constants. (#4963)
* Support specialization constants.
* Fix.
* Fix.
* Fix.
* Fix.
* Make sure specialization constants have names.
* Clean up and support the dxc [vk::constant_id] syntax.
* Fix.
* Fix.
* Fix.
Diffstat (limited to 'source/slang/slang-parser.cpp')
| -rw-r--r-- | source/slang/slang-parser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index b3a18f8a8..04ada006c 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -8190,7 +8190,7 @@ namespace Slang CASE(push_constant, PushConstantAttribute) CASE(shaderRecordNV, ShaderRecordAttribute) CASE(shaderRecordEXT, ShaderRecordAttribute) - CASE(constant_id, GLSLConstantIDLayoutModifier) + CASE(constant_id, VkConstantIdAttribute) CASE(std140, GLSLStd140Modifier) CASE(std430, GLSLStd430Modifier) CASE(scalar, GLSLScalarModifier) @@ -8228,6 +8228,11 @@ namespace Slang parser->diagnose(modifier->loc, Diagnostics::missingLayoutBindingModifier); } } + else if (auto specConstAttr = as<VkConstantIdAttribute>(modifier)) + { + parser->ReadToken(TokenType::OpAssign); + specConstAttr->location = (int)getIntegerLiteralValue(parser->ReadToken(TokenType::IntegerLiteral)); + } listBuilder.add(modifier); } |
