logo

Trait bevy::render::render_phase::BatchedPhaseItem[]

pub trait BatchedPhaseItem: EntityPhaseItem {
    fn batch_range(&self) -> &Option<Range<u32>>;
fn batch_range_mut(&mut self) -> &mut Option<Range<u32>>; fn add_to_batch(&mut self, other: &Self) -> BatchResult { ... } }
Expand description

A PhaseItem that can be batched dynamically.

Batching is an optimization that regroups multiple items in the same vertex buffer to render them in a single draw call.

Required methods

Range in the vertex buffer of this item

Range in the vertex buffer of this item

Provided methods

Batches another item within this item if they are compatible. Items can be batched together if they have the same entity, and consecutive ranges. If batching is successful, the other item should be discarded from the render pass.

Implementors