Skip to content

Commit bfd15d2

Browse files
mtsrcart
andcommitted
Fixes incorrect PipelineCompiler::compile_pipeline() step_mode (#2126)
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 <[email protected]>
1 parent 1690a9d commit bfd15d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_render/src/pipeline/pipeline_compiler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{state_descriptors::PrimitiveTopology, IndexFormat, PipelineDescriptor};
22
use crate::{
3-
pipeline::{BindType, InputStepMode, VertexBufferLayout},
3+
pipeline::{BindType, VertexBufferLayout},
44
renderer::RenderResourceContext,
55
shader::{Shader, ShaderError},
66
};
@@ -205,7 +205,7 @@ impl PipelineCompiler {
205205

206206
// the vertex buffer descriptor that will be used for this pipeline
207207
let mut compiled_vertex_buffer_descriptor = VertexBufferLayout {
208-
step_mode: InputStepMode::Vertex,
208+
step_mode: mesh_vertex_buffer_layout.step_mode,
209209
stride: mesh_vertex_buffer_layout.stride,
210210
..Default::default()
211211
};

0 commit comments

Comments
 (0)