summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-12-01 18:55:43 -0800
committerGitHub <noreply@github.com>2022-12-01 18:55:43 -0800
commite7df8538eb8f0ed06f0838d946bec8e9e0fe0985 (patch)
tree3c08e646600ab82ffda260f2b6deb96dd2085776 /source/slang/slang-lower-to-ir.cpp
parentf51f69d045d9e0b83d9ab1f4623d4319ce1867be (diff)
Allow `no_diff` on `this` parameter. (#2543)
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 28639ae53..f836824f7 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -2884,6 +2884,11 @@ void collectParameterLists(
auto thisType = getThisParamTypeForContainer(context, parentDeclRef);
if(thisType)
{
+ if (declRef.getDecl()->findModifier<NoDiffThisAttribute>())
+ {
+ auto noDiffAttr = context->astBuilder->getNoDiffModifierVal();
+ thisType = context->astBuilder->getModifiedType(thisType, 1, &noDiffAttr);
+ }
addThisParameter(innerThisParamDirection, thisType, ioParameterLists);
}
}