summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-shader.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-04-30 14:17:45 -0700
committerGitHub <noreply@github.com>2025-04-30 14:17:45 -0700
commit7f1df9d0b31413e59846cc955d2a955d3f361e2a (patch)
tree8cfcb7b6dde96f90e9581f9a904a25158a7358cb /source/slang/slang-check-shader.cpp
parent678de6547bc8cac15e31de30b400e9a3b45c216f (diff)
Initial support for immutable lambda expressions. (#6914)
* Initial support for immutable lambda expressions. * More diagnostics, and langauge server fix. * Language server fix. * Fix bug identified in review. * Add expected result. * Update expected result.
Diffstat (limited to 'source/slang/slang-check-shader.cpp')
-rw-r--r--source/slang/slang-check-shader.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/slang/slang-check-shader.cpp b/source/slang/slang-check-shader.cpp
index 4547281e1..6a713f412 100644
--- a/source/slang/slang-check-shader.cpp
+++ b/source/slang/slang-check-shader.cpp
@@ -727,6 +727,27 @@ Type* getParamType(ASTBuilder* astBuilder, DeclRef<VarDeclBase> paramDeclRef)
return paramType;
}
+Type* getParamTypeWithDirectionWrapper(ASTBuilder* astBuilder, DeclRef<VarDeclBase> paramDeclRef)
+{
+ auto result = getParamType(astBuilder, paramDeclRef);
+ auto direction = getParameterDirection(paramDeclRef.getDecl());
+ switch (direction)
+ {
+ case kParameterDirection_In:
+ return result;
+ case kParameterDirection_ConstRef:
+ return astBuilder->getConstRefType(result);
+ case kParameterDirection_Out:
+ return astBuilder->getOutType(result);
+ case kParameterDirection_InOut:
+ return astBuilder->getInOutType(result);
+ case kParameterDirection_Ref:
+ return astBuilder->getRefType(result, AddressSpace::Generic);
+ default:
+ return result;
+ }
+}
+
void Module::_collectShaderParams()
{
// We are going to walk the global declarations in the body of the