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-emit-spirv.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/slang/slang-emit-spirv.cpp') diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 1e6f27e7f..62c667de1 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -6824,7 +6824,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex getStructFieldId(baseStructType, as(fieldAddress->getField())), builder.getIntType()); SLANG_ASSERT(as(fieldAddress->getFullType())); - return emitOpAccessChain( + return emitOpInBoundsAccessChain( parent, fieldAddress, fieldAddress->getFullType(), @@ -6869,7 +6869,6 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex // We might replace resultType with a different storage class equivalent auto resultType = as(inst->getDataType()); SLANG_ASSERT(resultType); - if (const auto basePtrType = as(base->getDataType())) { // If the base pointer has a specific address space and the -- cgit v1.2.3