diff options
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 9d538a774..6112beaf2 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3109,6 +3109,17 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitBackwardDifferentiateInst(IRType* type, IRInst* baseFn) + { + auto inst = createInst<IRBackwardDifferentiate>( + this, + kIROp_BackwardDifferentiate, + type, + baseFn); + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitMakeDifferentialPair(IRType* type, IRInst* primal, IRInst* differential) { IRInst* args[] = {primal, differential}; @@ -4556,6 +4567,17 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitNeg(IRType* type, IRInst* value) + { + auto inst = createInst<IRInst>( + this, + kIROp_Neg, + type, + value); + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitAdd(IRType* type, IRInst* left, IRInst* right) { auto inst = createInst<IRInst>( |
