From 4c4826d47eeef4675daae4ae53ff76f4d5ebd84a Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Feb 2023 13:55:32 -0800 Subject: Overhaul global inst deduplication and cpp/cuda backend. (#2654) * Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He --- source/slang/slang-ir-collect-global-uniforms.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-collect-global-uniforms.cpp') diff --git a/source/slang/slang-ir-collect-global-uniforms.cpp b/source/slang/slang-ir-collect-global-uniforms.cpp index ca5e56b53..ad0dfda91 100644 --- a/source/slang/slang-ir-collect-global-uniforms.cpp +++ b/source/slang/slang-ir-collect-global-uniforms.cpp @@ -192,7 +192,8 @@ struct CollectGlobalUniformParametersContext // per-field layout information to reference the key we created // instead of the existing parameter (which we will be removing). // - fieldLayoutAttr->setOperand(0, fieldKey); + fieldLayoutAttr = as( + builder->replaceOperand(fieldLayoutAttr->getOperands(), fieldKey)); // If the given parameter doesn't contribute to uniform/ordinary usage, then // we can safely leave it at the global scope and potentially avoid a lot @@ -266,7 +267,7 @@ struct CollectGlobalUniformParametersContext // if(auto layoutAttr = as(user)) { - layoutAttr->setOperand(0, fieldKey); + builder->replaceOperand(layoutAttr->getOperands(), fieldKey); continue; } -- cgit v1.2.3