pub struct RenderGraph { /* private fields */ }Expand description
Render graph managing passes and resources.
Implementations§
Source§impl RenderGraph
impl RenderGraph
Sourcepub fn add_texture(
&mut self,
name: impl Into<String>,
size: (u32, u32, u32),
format: TextureFormat,
usage: TextureUsages,
) -> ResourceId
pub fn add_texture( &mut self, name: impl Into<String>, size: (u32, u32, u32), format: TextureFormat, usage: TextureUsages, ) -> ResourceId
Add a texture resource to the graph.
Sourcepub fn add_buffer(
&mut self,
name: impl Into<String>,
size: u64,
usage: BufferUsages,
) -> ResourceId
pub fn add_buffer( &mut self, name: impl Into<String>, size: u64, usage: BufferUsages, ) -> ResourceId
Add a buffer resource to the graph.
Sourcepub fn add_pass(&mut self, pass: RenderGraphPass) -> PassId
pub fn add_pass(&mut self, pass: RenderGraphPass) -> PassId
Add a render pass to the graph.
Sourcepub fn compile(&mut self) -> Result<ExecutionPlan, RenderGraphError>
pub fn compile(&mut self) -> Result<ExecutionPlan, RenderGraphError>
Compile the render graph into an execution plan.
This performs topological sorting of passes based on their dependencies.
Sourcepub fn execute(
&self,
graphics: Arc<GraphicsContext>,
) -> Result<(), RenderGraphError>
pub fn execute( &self, graphics: Arc<GraphicsContext>, ) -> Result<(), RenderGraphError>
Execute the render graph.
This must be called after compile().
Sourcepub fn pass_count(&self) -> usize
pub fn pass_count(&self) -> usize
Get the number of passes in the graph.
Sourcepub fn resource_count(&self) -> usize
pub fn resource_count(&self) -> usize
Get the number of resources in the graph.
Sourcepub fn is_compiled(&self) -> bool
pub fn is_compiled(&self) -> bool
Check if the graph has been compiled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderGraph
impl !RefUnwindSafe for RenderGraph
impl Send for RenderGraph
impl Sync for RenderGraph
impl Unpin for RenderGraph
impl UnsafeUnpin for RenderGraph
impl !UnwindSafe for RenderGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more