Restore unintentional support for zero-size buffers

This commit is contained in:
Andy Leiserson
2025-07-02 14:16:02 -07:00
committed by Jim Blandy
parent ef428fcab8
commit c0a580d6f0
16 changed files with 129 additions and 101 deletions

View File

@@ -61,6 +61,12 @@ pub type BufferAddress = u64;
/// [`BufferSlice`]: ../wgpu/struct.BufferSlice.html
pub type BufferSize = core::num::NonZeroU64;
/// Integral type used for buffer sizes that may be zero.
///
/// Although the wgpu Rust API disallows zero-size `BufferSlice` and wgpu-hal
/// disallows zero-size bindings, WebGPU permits zero-size buffers and bindings.
pub type BufferSizeOrZero = u64;
/// Integral type used for binding locations in shaders.
///
/// Used in [`VertexAttribute`]s and errors.