diff options
Diffstat (limited to 'source/slang/slang-ir-undo-param-copy.cpp')
| -rw-r--r-- | source/slang/slang-ir-undo-param-copy.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/slang/slang-ir-undo-param-copy.cpp b/source/slang/slang-ir-undo-param-copy.cpp index d8aac7201..75ee8a03a 100644 --- a/source/slang/slang-ir-undo-param-copy.cpp +++ b/source/slang/slang-ir-undo-param-copy.cpp @@ -6,7 +6,7 @@ namespace Slang { -// This pass transforms variables decorated with TempCallArgVarDecoration +// This pass transforms variables decorated with TempCallArgImmutableVarDecoration // by replacing them with direct references to the original parameters. // This is important for CUDA/OptiX targets where functions like 'IgnoreHit' // can prevent copy-back operations from executing. @@ -52,7 +52,17 @@ struct UndoParameterCopyVisitor { if (auto varInst = as<IRVar>(inst)) { - if (varInst->findDecoration<IRTempCallArgVarDecoration>()) + bool isTempCallArgVar = false; + for (auto decor : varInst->getDecorations()) + { + if (as<IRTempCallArgImmutableVarDecoration>(decor) || + as<IRTempCallArgVarDecoration>(decor)) + { + isTempCallArgVar = true; + break; + } + } + if (isTempCallArgVar) { IRStore* initializingStore = nullptr; IRInst* originalParamPtr = nullptr; |
