[metal] cap the storage binding size at u32::MAX - 4 again (#10306)

Co-authored-by: nuri-yoo <nuri-yoo@users.noreply.github.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-09-17 04:26:26 +00:00
1 parent 7e43e103f0
commit be43b095f2
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -225,6 +225,7 @@ By @sagudev in [#10109](https://github.com/gfx-rs/wgpu/pull/10109).
#### Metal
- Cap `max_storage_buffer_binding_size` to `u32::MAX - 4` again. By @nuri-yoo in [#10306](https://github.com/gfx-rs/wgpu/pull/10306).
- Fix a crash/hang when configuring a surface with the `Bt2100Pq`, `Bt2100Hlg`, or `ExtendedDisplayP3` color space: the dynamically resolved CoreGraphics color-space constants were read with one level of indirection missing. By @stuartparmenter in [#10175](https://github.com/gfx-rs/wgpu/pull/10175).
- Fix bind group resources for the task, mesh, fragment, and compute shader stages being bound from the wrong offsets whenever a bind group contained resources visible to the task or mesh stages, which could bind the wrong buffer, texture, or sampler to a shader slot. By @teoxoy in [#10043](https://github.com/gfx-rs/wgpu/issues/10043).
- Report an error instead of panicking when Metal declines to create a texture view, which can occur for some views of textures with `TRANSIENT_ATTACHMENT` usage. By @matthargett in [#10145](https://github.com/gfx-rs/wgpu/pull/10145).
+4 -2
View File
@@ -1490,8 +1490,10 @@ impl super::CapabilitiesQuery {
max_buffer_size: self.max_buffer_size,
// No limit, use maxBufferSize.
max_uniform_buffer_binding_size: self.max_buffer_size,
// No limit, use maxBufferSize.
max_storage_buffer_binding_size: self.max_buffer_size,
// naga bounds-checks use `uint`. Limit to `u32::MAX` if enabled.
max_storage_buffer_binding_size: self
.max_buffer_size
.min(u64::from(u32::MAX) & !(wgt::STORAGE_BINDING_SIZE_ALIGNMENT as u64 - 1)),
min_uniform_buffer_offset_alignment: self.constant_buffer_offset_alignment,
// No documented limit. Use 32, which is the lowest allowed value.
min_storage_buffer_offset_alignment: 32,