Skip to content

Commit

Permalink
Fixes incorrect PipelineCompiler::compile_pipeline() step_mode (#2126)
Browse files Browse the repository at this point in the history
There's what might be considered a proper bug in `PipelineCompiler::compile_pipeline()`, where it overwrites the `step_mode` for the passed in `VertexBufferLayout` with `InputStepMode::Vertex`. Due to this some ugly workarounds are needed to do any kind of instancing.

In the somewhat longer term, `PipelineCompiler::compile_pipeline()` should probably also handle a `Vec<VertexBufferLayout>`, but that would be a (slightly) larger PR, rather than a bugfix. And I'd love to have this fix in sooner than we can deal with a bigger PR.
  • Loading branch information
mtsr committed May 7, 2021
1 parent 1690a9d commit ff06ed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_render/src/pipeline/pipeline_compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl PipelineCompiler {

// the vertex buffer descriptor that will be used for this pipeline
let mut compiled_vertex_buffer_descriptor = VertexBufferLayout {
step_mode: InputStepMode::Vertex,
step_mode: mesh_vertex_buffer_layout.step_mode,
stride: mesh_vertex_buffer_layout.stride,
..Default::default()
};
Expand Down

0 comments on commit ff06ed8

Please sign in to comment.