Merge pull request #834 from billhollings/master
Fix Metal validation assertion on VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md
index df92467..d683008 100644
--- a/Docs/Whats_New.md
+++ b/Docs/Whats_New.md
@@ -22,6 +22,8 @@
- Fix issue where immutable samplers are removed during descriptor update.
- Guard against Metal validation assertion from reuse of query number
within a single `MTLRenderEncoder`.
+- Increase value of `VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment`
+ to `16` to avoid Metal validation assertions.
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
index 4e30acd..c775103 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
@@ -1224,7 +1224,7 @@
_properties.limits.minMemoryMapAlignment = _metalFeatures.mtlBufferAlignment;
_properties.limits.minUniformBufferOffsetAlignment = _metalFeatures.mtlBufferAlignment;
- _properties.limits.minStorageBufferOffsetAlignment = 4;
+ _properties.limits.minStorageBufferOffsetAlignment = 16;
_properties.limits.bufferImageGranularity = _metalFeatures.mtlBufferAlignment;
_properties.limits.nonCoherentAtomSize = _metalFeatures.mtlBufferAlignment;