diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-01-29 17:42:28 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-29 17:42:28 -0800 |
| commit | cbcb97a64c0b7b908fc7be565b0d6141d2f1a1f7 (patch) | |
| tree | 21e60b34a0ebe9598cc72e2895db00b8a124573c /source | |
| parent | 2ba6458eba8bd2d4f4d2ffdd452ae089e5b50907 (diff) | |
Update SPIRV submodules and fix tests (#6222)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 7c2e80846..24d8cc0c6 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -1669,11 +1669,19 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex &sizeAndAlignment); stride = (int)sizeAndAlignment.getStride(); } - emitOpDecorateArrayStride( - getSection(SpvLogicalSectionID::Annotations), - nullptr, - arrayType, - SpvLiteralInteger::from32(stride)); + + // Avoid validation error: Array containing a Block or BufferBlock must not be + // decorated with ArrayStride + if (!elementType->findDecorationImpl(kIROp_SPIRVBufferBlockDecoration) && + !elementType->findDecorationImpl(kIROp_SPIRVBlockDecoration)) + { + emitOpDecorateArrayStride( + getSection(SpvLogicalSectionID::Annotations), + nullptr, + arrayType, + SpvLiteralInteger::from32(stride)); + } + return arrayType; } case kIROp_AtomicType: |
