From e4b01c4ba53c40ff0704e72615422e5a96f636e3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 13 Mar 2024 18:35:42 -0700 Subject: Fix side effect checking around storage buffer type. (#3762) --- source/slang/slang-ir-util.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 295fbd642..d66c8d0be 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -689,6 +689,7 @@ bool isPtrLikeOrHandleType(IRInst* type) case kIROp_PtrType: case kIROp_RefType: case kIROp_ConstRefType: + case kIROp_GLSLShaderStorageBufferType: return true; } return false; @@ -1175,6 +1176,11 @@ bool isGlobalOrUnknownMutableAddress(IRGlobalValueWithCode* parentFunc, IRInst* if (root) { + if (as(root->getDataType())) + { + // A storage buffer is mutable, so we need to treat it as a mutable address. + return true; + } // If this is a global readonly resource, it is not a mutable address. if (as(root->getDataType())) { -- cgit v1.2.3