From 7ffb9f53e41c409a51c41318442067cc6c7e4f48 Mon Sep 17 00:00:00 2001 From: Jerran Schmidt Date: Wed, 2 Jul 2025 14:22:42 +1000 Subject: Fix for emitting ArrayStride decoration for arrays of opaque types (#7568) * WIP opaque type decoration fix * Clearer intent * Formatting * Added test for fix --- source/slang/slang-emit-spirv.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 62c667de1..7f6202a7f 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -2060,7 +2060,9 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex inst->getOp() == kIROp_ArrayType ? emitOpTypeArray(inst, elementType, irArrayType->getElementCount()) : emitOpTypeRuntimeArray(inst, elementType); - if (shouldEmitArrayStride(irArrayType->getElementType())) + // Arrays of opaque types should not emit a stride + if (!isIROpaqueType(elementType) && + shouldEmitArrayStride(irArrayType->getElementType())) { auto stride = 0; // If the array type has no stride, it indicates that this array type is only -- cgit v1.2.3