Trait bevy_render::render_graph::ViewNode

source ·
pub trait ViewNode {
    type ViewQuery: ReadOnlyQueryData;

    // Required method
    fn run<'w>(
        &self,
        graph: &mut RenderGraphContext<'_>,
        render_context: &mut RenderContext<'w>,
        view_query: QueryItem<'w, Self::ViewQuery>,
        world: &'w World
    ) -> Result<(), NodeRunError>;

    // Provided method
    fn update(&mut self, _world: &mut World) { ... }
}
Expand description

This trait should be used instead of the Node trait when making a render node that runs on a view.

It is intended to be used with ViewNodeRunner

Required Associated Types§

source

type ViewQuery: ReadOnlyQueryData

The query that will be used on the view entity. It is guaranteed to run on the view entity, so there’s no need for a filter

Required Methods§

source

fn run<'w>( &self, graph: &mut RenderGraphContext<'_>, render_context: &mut RenderContext<'w>, view_query: QueryItem<'w, Self::ViewQuery>, world: &'w World ) -> Result<(), NodeRunError>

Runs the graph node logic, issues draw calls, updates the output slots and optionally queues up subgraphs for execution. The graph data, input and output values are passed via the RenderGraphContext.

Provided Methods§

source

fn update(&mut self, _world: &mut World)

Updates internal node state using the current render World prior to the run method.

Implementors§