summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-spirv.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 5036333c1..e8bcad1c1 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -1876,11 +1876,14 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
stride = (valueSize >= (uint64_t)sizeAndAlignment.kIndeterminateSize)
? 0xFFFF
: (uint32_t)sizeAndAlignment.getStride();
- emitOpDecorateArrayStride(
- getSection(SpvLogicalSectionID::Annotations),
- nullptr,
- resultSpvType,
- SpvLiteralInteger::from32(stride));
+ if (stride != 0)
+ {
+ emitOpDecorateArrayStride(
+ getSection(SpvLogicalSectionID::Annotations),
+ nullptr,
+ resultSpvType,
+ SpvLiteralInteger::from32(stride));
+ }
}
}
return resultSpvType;