From c701ec00ccce6dfa8094d6550ce2db929fc8cefe Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 1 Jul 2025 19:09:29 -0700 Subject: Defer immutable buffer loads when emitting spirv. (#7579) * Defer immutable buffer loads when emitting spirv. * Fix. * Fix. * Fix. * Fix tests. * Fix test. --- source/slang/slang-check-decl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 6d8788b4f..9c77303b9 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -14471,6 +14471,15 @@ VarDeclBase* getTrailingUnsizedArrayElement( return nullptr; } +bool isImmutableBufferType(Type* type) +{ + if (as(type)) + return true; + if (auto resourceType = as(type)) + return resourceType->getAccess() == SLANG_RESOURCE_ACCESS_READ; + return false; +} + bool isOpaqueHandleType(Type* type) { while (auto modifiedType = as(type)) -- cgit v1.2.3