summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-03-21 21:29:13 -0700
committerGitHub <noreply@github.com>2023-03-21 21:29:13 -0700
commitd8a40abba5223fbcb56c52b04ccb88c02bbaf79f (patch)
tree3207babbce41957fbd01c3c791fe9957c81f6a09 /source/slang/slang-lower-to-ir.cpp
parent83876733d69582eec6bad26af64a651d40fa43aa (diff)
[TreatAsDifferentiable] functions. (#2720)
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 8164723b6..86df89702 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -8502,6 +8502,10 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
{
getBuilder()->addBackwardDifferentiableDecoration(irFunc);
}
+ else if (as<TreatAsDifferentiableAttribute>(modifier))
+ {
+ getBuilder()->addDecoration(irFunc, kIROp_TreatAsDifferentiableDecoration);
+ }
}
// For convenience, ensure that any additional global
// values that were emitted while outputting the function