pub trait RenderPass {
type Params: ReadOnlySystemParam;
// Required methods
fn describe(
params: &SystemParamItem<'_, '_, Self::Params>,
) -> RenderPassDesc;
fn id() -> RenderPassId;
fn label() -> &'static str;
// Provided method
fn custom_render(
_world: &mut World,
_command_buffer: &mut CommandBuffer,
) -> Option<bool> { ... }
}Expand description
Describes a render pass in the render graph, with its attachments, load ops, etc.
This is returned by the describe method of the RenderPass trait, which is called in the render world before rendering to get the pass description and attachments.
See crate::passes for more details and examples.
Required Associated Types§
Required Methods§
Sourcefn describe(params: &SystemParamItem<'_, '_, Self::Params>) -> RenderPassDesc
fn describe(params: &SystemParamItem<'_, '_, Self::Params>) -> RenderPassDesc
Describe the render pass (attachments, load ops, etc).
Sourcefn id() -> RenderPassId
fn id() -> RenderPassId
Return the unique numeric ID of this render pass. Passes execute in order of their IDs (lower IDs execute first).
Provided Methods§
Sourcefn custom_render(
_world: &mut World,
_command_buffer: &mut CommandBuffer,
) -> Option<bool>
fn custom_render( _world: &mut World, _command_buffer: &mut CommandBuffer, ) -> Option<bool>
Custom rendering logic for this pass. This can be used for passes that require custom rendering logic that doesn’t fit into the default render graph execution flow.
Notes:
- Returns None by default, meaning the pass will be rendered with the default render graph execution flow.
- If it returns Some(true), it means the pass executed custom rendering logic and should be considered successfully rendered for this frame.
- The provided command buffer is already begun and will be submitted at the end of the render graph execution, so the custom rendering logic can simply record commands to it.
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.