diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-13 18:35:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 18:35:42 -0700 |
| commit | e4b01c4ba53c40ff0704e72615422e5a96f636e3 (patch) | |
| tree | e339f84d7dba74d26e22cde9a296d8cd78d24bb7 /source/slang/slang-ir-util.cpp | |
| parent | 25df6b868c2af58435bbd09d89e64d77bea87bc7 (diff) | |
Fix side effect checking around storage buffer type. (#3762)
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<IRGLSLShaderStorageBufferType>(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<IRParameterGroupType>(root->getDataType())) { |
