summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-shader.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-09-19 16:27:50 -0400
committerGitHub <noreply@github.com>2024-09-19 13:27:50 -0700
commitdd3d80e61b316390a468a142de2be2fb85b73d0d (patch)
treecbfd3ddcbaed84de335818e9e618d7c3ebff6ecd /source/slang/slang-check-shader.cpp
parent9d40ce4e8921ef468281c91f052dbd443ecf56e2 (diff)
Allow lookups of overloaded methods. (#5110)
* Allow lookups of overloaded methods. * Update slang-reflection-api.cpp * Update slang.cpp --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-check-shader.cpp')
-rw-r--r--source/slang/slang-check-shader.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/slang/slang-check-shader.cpp b/source/slang/slang-check-shader.cpp
index 1718c3afd..08bac1f78 100644
--- a/source/slang/slang-check-shader.cpp
+++ b/source/slang/slang-check-shader.cpp
@@ -235,8 +235,17 @@ namespace Slang
Name* name,
DiagnosticSink* sink)
{
- auto declRef = translationUnit->findDeclFromString(getText(name), sink);
- FuncDecl* entryPointFuncDecl = declRef.as<FuncDecl>().getDecl();
+ FuncDecl* entryPointFuncDecl = nullptr;
+
+ auto expr = translationUnit->findDeclFromString(getText(name), sink);
+ if (auto declRefExpr = as<DeclRefExpr>(expr))
+ {
+ auto declRef = declRefExpr->declRef;
+ entryPointFuncDecl = declRef.as<FuncDecl>().getDecl();
+
+ if (entryPointFuncDecl && getModule(entryPointFuncDecl) != translationUnit)
+ entryPointFuncDecl = nullptr;
+ }
if (entryPointFuncDecl && getModule(entryPointFuncDecl) != translationUnit)
entryPointFuncDecl = nullptr;