Skip to content

Commit

Permalink
Validate max_vertex_buffers in render bundles. (#5025)
Browse files Browse the repository at this point in the history
  • Loading branch information
nical authored Jan 9, 2024
1 parent 8af6975 commit 1bc71eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wgpu-core/src/command/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ impl RenderBundleEncoder {
size,
} => {
let scope = PassErrorScope::SetVertexBuffer(buffer_id);

let max_vertex_buffers = device.limits.max_vertex_buffers;
if slot >= max_vertex_buffers {
return Err(RenderCommandError::VertexBufferIndexOutOfRange {
index: slot,
max: max_vertex_buffers,
})
.map_pass_err(scope);
}

let buffer = state
.trackers
.buffers
Expand Down

0 comments on commit 1bc71eb

Please sign in to comment.