Skip to content

Commit

Permalink
Grow the VertexState inputs in SetPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JCapucho committed Dec 7, 2020
1 parent 7b886f4 commit 713c23b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,14 +1164,17 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {

state.index.pipeline_format = pipeline.index_format;

let vertex_strides_len = pipeline.vertex_strides.len();
while state.vertex.inputs.len() < vertex_strides_len {
state.vertex.inputs.push(VertexBufferState::EMPTY);
}
// Update vertex buffer limits
for (vbs, &(stride, rate)) in
state.vertex.inputs.iter_mut().zip(&pipeline.vertex_strides)
{
vbs.stride = stride;
vbs.rate = rate;
}
let vertex_strides_len = pipeline.vertex_strides.len();
for vbs in state.vertex.inputs.iter_mut().skip(vertex_strides_len) {
vbs.stride = 0;
vbs.rate = InputStepMode::Vertex;
Expand Down

0 comments on commit 713c23b

Please sign in to comment.