From 43d44c89e18d0c39524afa8451d1aef70d98913f Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 23 Aug 2021 16:50:34 -0400 Subject: [PATCH] Bump the vertex buffer sizes by 1 --- wgpu-core/src/device/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 7cd65e1de6..f2c68e3e20 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -504,6 +504,9 @@ impl Device { let actual_size = if desc.size == 0 { wgt::COPY_BUFFER_ALIGNMENT + } else if desc.usage.contains(wgt::BufferUsages::VERTEX) { + // Bumping the size by 1 so that we can bind an empty range at the end of the buffer. + desc.size + 1 } else { desc.size };