summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-09-12 10:49:16 -0700
committerGitHub <noreply@github.com>2023-09-12 10:49:16 -0700
commitc0a77c360436c4f1ec4d284e331063c35bdf95ad (patch)
tree6c1379a074304bdee3f33f6861754112d7d12c47 /source/slang/slang-lower-to-ir.cpp
parent3f4081d854db2d186adea4067da575eca7c7adf1 (diff)
Direct SPIRV for RayTracing Inline. (#3201)
* Direct SPIRV for RayTracing Inline. * Fix. * Cleanup. * Fix compile error. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 106e5b5a3..8d1a86d4d 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -2537,12 +2537,18 @@ ParameterDirection getParameterDirection(VarDeclBase* paramDecl)
///
ParameterDirection getThisParamDirection(Decl* parentDecl, ParameterDirection defaultDirection)
{
+ auto parentParent = getParentDecl(parentDecl);
// The `this` parameter for a `class` is always `in`.
- if (as<ClassDecl>(parentDecl->parentDecl))
+ if (as<ClassDecl>(parentParent))
{
return kParameterDirection_In;
}
+ if (parentParent->findModifier<NonCopyableTypeAttribute>())
+ {
+ return kParameterDirection_Ref;
+ }
+
// Applications can opt in to a mutable `this` parameter,
// by applying the `[mutating]` attribute to their
// declaration.