Skip to content

Commit

Permalink
Merge pull request #1855 from kvark/vertex-offset
Browse files Browse the repository at this point in the history
Bump the vertex buffer sizes by 1
  • Loading branch information
cwfitzgerald authored Aug 24, 2021
2 parents 663cb30 + 43d44c8 commit 0a3fd15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ impl<A: HalApi> Device<A> {

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
};
Expand Down

0 comments on commit 0a3fd15

Please sign in to comment.