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.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
  • Loading branch information
mtsr and cart committed May 7, 2021
1 parent 1690a9d commit bfd15d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_render/src/pipeline/pipeline_compiler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{state_descriptors::PrimitiveTopology, IndexFormat, PipelineDescriptor};
use crate::{
pipeline::{BindType, InputStepMode, VertexBufferLayout},
pipeline::{BindType, VertexBufferLayout},
renderer::RenderResourceContext,
shader::{Shader, ShaderError},
};
Expand Down 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 bfd15d2

Please sign in to comment.