summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-05-15 12:51:29 -0700
committerGitHub <noreply@github.com>2025-05-15 12:51:29 -0700
commit0d6312f3be66f4bff9eec9606228db3edc309e2c (patch)
treea868e452e2d25a88f8a6cdee109a280edd11c0fb /source/slang/slang.cpp
parentd961f4438ef865028d289148d22e0fb5c0d8319a (diff)
Add checking for hlsl register semantic. (#7118)
* Add checking for hlsl register semantic. * Fix. * Fix test. * Fix switch error. * Fix tests.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index c7f6c920c..7fc519c03 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -2784,7 +2784,12 @@ Type* ComponentType::getTypeFromString(String const& typeStr, DiagnosticSink* si
SLANG_AST_BUILDER_RAII(linkage->getASTBuilder());
Expr* typeExpr = linkage->parseTermString(typeStr, scope);
- type = checkProperType(linkage, TypeExp(typeExpr), sink);
+ SharedSemanticsContext sharedSemanticsContext(linkage, nullptr, sink);
+ SemanticsVisitor visitor(&sharedSemanticsContext);
+ type = visitor.TranslateTypeNode(typeExpr);
+ auto typeOut = visitor.tryCoerceToProperType(TypeExp(type));
+ if (typeOut.type)
+ type = typeOut.type;
if (type)
{