pub trait FramePass {
// Required methods
fn name(&self) -> &'static str;
fn stage(&self) -> PassStage;
fn record(
&mut self,
encoder: &mut CommandEncoder,
target: &FrameTarget<'_>,
) -> Result<()>;
fn attach(&mut self, gpu: &GpuContext, frame: FrameFormat) -> Result<()>;
// Provided methods
fn color_load(&self) -> ColorLoad { ... }
fn depth_convention(&self) -> Option<DepthConvention> { ... }
fn depth_read(&self) -> Option<DepthConvention> { ... }
fn shares_pass(&self) -> bool { ... }
fn clear_color(&self) -> Color { ... }
fn prepare(
&mut self,
_encoder: &mut CommandEncoder,
_target: &FrameTarget<'_>,
) -> Result<()> { ... }
fn draw(
&mut self,
_pass: &mut RenderPass<'_>,
_target: &FrameTarget<'_>,
) -> Result<()> { ... }
}Required Methods§
fn name(&self) -> &'static str
fn stage(&self) -> PassStage
fn record( &mut self, encoder: &mut CommandEncoder, target: &FrameTarget<'_>, ) -> Result<()>
fn attach(&mut self, gpu: &GpuContext, frame: FrameFormat) -> Result<()>
Provided Methods§
fn color_load(&self) -> ColorLoad
Sourcefn depth_convention(&self) -> Option<DepthConvention>
fn depth_convention(&self) -> Option<DepthConvention>
None means the pass writes no depth; Some must match the frame’s convention to register.
fn depth_read(&self) -> Option<DepthConvention>
True joins the stage’s shared render pass, so attach must build pipelines against the frame’s color and depth formats.
Sourcefn clear_color(&self) -> Color
fn clear_color(&self) -> Color
Read before prepare, and only when color_load is Clear.
Sourcefn prepare(
&mut self,
_encoder: &mut CommandEncoder,
_target: &FrameTarget<'_>,
) -> Result<()>
fn prepare( &mut self, _encoder: &mut CommandEncoder, _target: &FrameTarget<'_>, ) -> Result<()>
Encoder work for a sharing pass; runs just before its render pass opens, not at frame start.
Sourcefn draw(
&mut self,
_pass: &mut RenderPass<'_>,
_target: &FrameTarget<'_>,
) -> Result<()>
fn draw( &mut self, _pass: &mut RenderPass<'_>, _target: &FrameTarget<'_>, ) -> Result<()>
Runs inside the shared pass, which owns the load ops; viewport and scissor carry over from earlier draws.