mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-16 17:02:32 +00:00
Don't dirty the vertex buffer for stride/rate changes on bundles. (#2744)
`wgpu_core::command::bundle::State::set_pipeline` marks a vertex buffer slot dirty if the pipeline's stride or step mode for that vertex buffer slot differs from what had been previously established. The effect of marking the slot dirty is to ensure that a new `SetVertexBuffer` command is inserted before the next draw command that uses that vertex buffer. However, this is unnecessary: `wgpu_hal::CommandEncoder::set_vertex_buffer` does not need to be called simply because the stride or rate has changed.
This commit is contained in:
parent
be625f9a01
commit
d26c04c715
@ -1217,11 +1217,8 @@ impl<A: HalApi> State<A> {
|
||||
self.index.pipeline_format = index_format;
|
||||
|
||||
for (vs, &(stride, step_mode)) in self.vertex.iter_mut().zip(vertex_strides) {
|
||||
if vs.stride != stride || vs.rate != step_mode {
|
||||
vs.stride = stride;
|
||||
vs.rate = step_mode;
|
||||
vs.is_dirty = true;
|
||||
}
|
||||
vs.stride = stride;
|
||||
vs.rate = step_mode;
|
||||
}
|
||||
|
||||
let push_constants_changed = self
|
||||
|
Loading…
Reference in New Issue
Block a user