From 0d6312f3be66f4bff9eec9606228db3edc309e2c Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 15 May 2025 12:51:29 -0700 Subject: Add checking for hlsl register semantic. (#7118) * Add checking for hlsl register semantic. * Fix. * Fix test. * Fix switch error. * Fix tests. --- source/slang/slang.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/slang/slang.cpp') 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) { -- cgit v1.2.3