diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-21 21:29:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-21 21:29:13 -0700 |
| commit | d8a40abba5223fbcb56c52b04ccb88c02bbaf79f (patch) | |
| tree | 3207babbce41957fbd01c3c791fe9957c81f6a09 /source/slang/slang-lower-to-ir.cpp | |
| parent | 83876733d69582eec6bad26af64a651d40fa43aa (diff) | |
[TreatAsDifferentiable] functions. (#2720)
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 4 |
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 |
