summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-autodiff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-autodiff.cpp')
-rw-r--r--source/slang/slang-ir-autodiff.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang-ir-autodiff.cpp b/source/slang/slang-ir-autodiff.cpp
index 3b3224e2f..f6a977994 100644
--- a/source/slang/slang-ir-autodiff.cpp
+++ b/source/slang/slang-ir-autodiff.cpp
@@ -749,6 +749,19 @@ IRInst* DifferentiableTypeConformanceContext::getExtractExistensialTypeWitness(I
SLANG_UNIMPLEMENTED_X("TODO: Implement");
}
+
+void copyCheckpointHints(IRBuilder* builder, IRGlobalValueWithCode* oldInst, IRGlobalValueWithCode* newInst)
+{
+ for (auto decor = oldInst->getFirstDecoration(); decor; decor = decor->getNextDecoration())
+ {
+ if (auto chkHint = as<IRCheckpointHintDecoration>(decor))
+ {
+ SLANG_ASSERT(chkHint->getOperandCount() == 0);
+ builder->addDecoration(newInst, chkHint->getOp());
+ }
+ }
+}
+
void stripDerivativeDecorations(IRInst* inst)
{
for (auto decor = inst->getFirstDecoration(); decor; )