pub trait RenderCommand<P: PhaseItem> {
// Required method
fn render<'w>(
world: &'w World,
item: &P,
pass: &mut TrackedRenderPass<'w>,
) -> RenderCommandResult;
}Expand description
RenderCommand is a trait that runs an ECS query and produces one or more
TrackedRenderPass calls. Types implementing this trait can be composed (as tuples).
They can be registered as a Draw function via the
[AddRenderCommand::add_render_command] method.
§Example
The DrawPbr draw function is created from the following render command
tuple. Const generics are used to set specific bind group locations:
ⓘ
pub type DrawPbr = (
SetItemPipeline,
SetMeshViewBindGroup<0>,
SetStandardMaterialBindGroup<1>,
SetTransformBindGroup<2>,
DrawMesh,
);Required Methods§
Sourcefn render<'w>(
world: &'w World,
item: &P,
pass: &mut TrackedRenderPass<'w>,
) -> RenderCommandResult
fn render<'w>( world: &'w World, item: &P, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult
Renders the PhaseItem by issuing draw calls via the TrackedRenderPass.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.