pub struct RenderGraph {
    pub debug: bool,
    /* private fields */
}
Expand description

A composable graph of render pass operations.

RenderGraph instances are are intended for one-time use.

The design of this code originated with a combination of PassBuilder and render_graph.cpp.

Fields§

§debug: bool

Set to true (when in debug mode) in order to get a breakpoint hit where you want.

Implementations§

source§

impl RenderGraph

source

pub fn new() -> Self

Constructs a new RenderGraph.

source

pub fn begin_pass(&mut self, name: impl AsRef<str>) -> PassRef<'_>

Begins a new pass.

source

pub fn bind_node<'a, B>(&'a mut self, binding: B) -> <B as Edge<Self>>::Result
where B: Edge<Self> + Bind<&'a mut Self, <B as Edge<Self>>::Result>,

Binds a Vulkan acceleration structure, buffer, or image to this graph.

Bound nodes may be used in passes for pipeline and shader operations.

source

pub fn blit_image( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, filter: Filter ) -> &mut Self

Copy an image, potentially performing format conversion.

source

pub fn blit_image_region( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, filter: Filter, region: ImageBlit ) -> &mut Self

Copy a region of an image, potentially performing format conversion.

source

pub fn blit_image_regions( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, filter: Filter, regions: impl AsRef<[ImageBlit]> + 'static + Send ) -> &mut Self

Copy regions of an image, potentially performing format conversion.

source

pub fn clear_color_image( &mut self, image_node: impl Into<AnyImageNode> ) -> &mut Self

Clear a color image.

source

pub fn clear_color_image_value( &mut self, image_node: impl Into<AnyImageNode>, color_value: impl Into<ClearColorValue> ) -> &mut Self

Clear a color image.

source

pub fn clear_depth_stencil_image( &mut self, image_node: impl Into<AnyImageNode> ) -> &mut Self

Clears a depth/stencil image.

source

pub fn clear_depth_stencil_image_value( &mut self, image_node: impl Into<AnyImageNode>, depth: f32, stencil: u32 ) -> &mut Self

Clears a depth/stencil image.

source

pub fn copy_buffer( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyBufferNode> ) -> &mut Self

Copy data between buffers

source

pub fn copy_buffer_region( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyBufferNode>, region: BufferCopy ) -> &mut Self

Copy data between buffer regions.

source

pub fn copy_buffer_regions( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyBufferNode>, regions: impl AsRef<[BufferCopy]> + 'static + Send ) -> &mut Self

Copy data between buffer regions.

source

pub fn copy_buffer_to_image( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyImageNode> ) -> &mut Self

Copy data from a buffer into an image.

source

pub fn copy_buffer_to_image_region( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyImageNode>, region: BufferImageCopy ) -> &mut Self

Copy data from a buffer into an image.

source

pub fn copy_buffer_to_image_regions( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyImageNode>, regions: impl AsRef<[BufferImageCopy]> + 'static + Send ) -> &mut Self

Copy data from a buffer into an image.

source

pub fn copy_image( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode> ) -> &mut Self

Copy data between images.

source

pub fn copy_image_region( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, region: ImageCopy ) -> &mut Self

Copy data between images.

source

pub fn copy_image_regions( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, regions: impl AsRef<[ImageCopy]> + 'static + Send ) -> &mut Self

Copy data between images.

source

pub fn copy_image_to_buffer( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyBufferNode> ) -> &mut Self

Copy image data into a buffer.

source

pub fn copy_image_to_buffer_region( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyBufferNode>, region: BufferImageCopy ) -> &mut Self

Copy image data into a buffer.

source

pub fn copy_image_to_buffer_regions( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyBufferNode>, regions: impl AsRef<[BufferImageCopy]> + 'static + Send ) -> &mut Self

Copy image data into a buffer.

source

pub fn fill_buffer( &mut self, buffer_node: impl Into<AnyBufferNode>, data: u32 ) -> &mut Self

Fill a region of a buffer with a fixed value.

source

pub fn fill_buffer_region( &mut self, buffer_node: impl Into<AnyBufferNode>, data: u32, region: Range<DeviceSize> ) -> &mut Self

Fill a region of a buffer with a fixed value.

source

pub fn node_device_address( &self, node: impl Into<AnyBufferNode> ) -> DeviceAddress

Returns the device address of a buffer node.

§Panics

Panics if the buffer is not currently bound or was not created with the SHADER_DEVICE_ADDRESS usage flag.

source

pub fn node_info<N>(&self, node: N) -> <N as Information>::Info
where N: Information,

Returns information used to crate a node.

source

pub fn resolve(self) -> Resolver

Finalizes the graph and provides an object with functions for submitting the resulting commands.

source

pub fn unbind_node<N>(&mut self, node: N) -> <N as Edge<Self>>::Result
where N: Edge<Self> + Unbind<Self, <N as Edge<Self>>::Result>,

Removes a node from this graph.

Future access to node on this graph will return invalid results.

source

pub fn update_buffer( &mut self, buffer_node: impl Into<AnyBufferNode>, data: impl AsRef<[u8]> + 'static + Send ) -> &mut Self

Note: data must not exceed 65536 bytes.

source

pub fn update_buffer_offset( &mut self, buffer_node: impl Into<AnyBufferNode>, offset: DeviceSize, data: impl AsRef<[u8]> + 'static + Send ) -> &mut Self

Note: data must not exceed 65536 bytes.

Trait Implementations§

source§

impl<'a> Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for &'a Arc<Lease<AccelerationStructure>>

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Arc<Lease<AccelerationStructure>>

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Lease<AccelerationStructure>

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl<'a> Bind<&mut RenderGraph, AccelerationStructureNode> for &'a Arc<AccelerationStructure>

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, AccelerationStructureNode> for AccelerationStructure

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, AccelerationStructureNode> for Arc<AccelerationStructure>

source§

fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode

Binds the resource to a graph-like object. Read more
source§

impl<'a> Bind<&mut RenderGraph, BufferLeaseNode> for &'a Arc<Lease<Buffer>>

source§

fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, BufferLeaseNode> for Arc<Lease<Buffer>>

source§

fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, BufferLeaseNode> for Lease<Buffer>

source§

fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl<'a> Bind<&mut RenderGraph, BufferNode> for &'a Arc<Buffer>

source§

fn bind(self, graph: &mut RenderGraph) -> BufferNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, BufferNode> for Arc<Buffer>

source§

fn bind(self, graph: &mut RenderGraph) -> BufferNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, BufferNode> for Buffer

source§

fn bind(self, graph: &mut RenderGraph) -> BufferNode

Binds the resource to a graph-like object. Read more
source§

impl<'a> Bind<&mut RenderGraph, ImageLeaseNode> for &'a Arc<Lease<Image>>

source§

fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, ImageLeaseNode> for Arc<Lease<Image>>

source§

fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, ImageLeaseNode> for Lease<Image>

source§

fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode

Binds the resource to a graph-like object. Read more
source§

impl<'a> Bind<&mut RenderGraph, ImageNode> for &'a Arc<Image>

source§

fn bind(self, graph: &mut RenderGraph) -> ImageNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, ImageNode> for Arc<Image>

source§

fn bind(self, graph: &mut RenderGraph) -> ImageNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, ImageNode> for Image

source§

fn bind(self, graph: &mut RenderGraph) -> ImageNode

Binds the resource to a graph-like object. Read more
source§

impl Bind<&mut RenderGraph, SwapchainImageNode> for SwapchainImage

source§

fn bind(self, graph: &mut RenderGraph) -> SwapchainImageNode

Binds the resource to a graph-like object. Read more
source§

impl Debug for RenderGraph

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Unbind<RenderGraph, Arc<AccelerationStructure>> for AccelerationStructureNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<AccelerationStructure>

Unbinds the resource from a graph-like object. Read more
source§

impl Unbind<RenderGraph, Arc<Buffer>> for BufferNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<Buffer>

Unbinds the resource from a graph-like object. Read more
source§

impl Unbind<RenderGraph, Arc<Image>> for ImageNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<Image>

Unbinds the resource from a graph-like object. Read more
source§

impl Unbind<RenderGraph, Arc<Lease<AccelerationStructure>>> for AccelerationStructureLeaseNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<Lease<AccelerationStructure>>

Unbinds the resource from a graph-like object. Read more
source§

impl Unbind<RenderGraph, Arc<Lease<Buffer>>> for BufferLeaseNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<Lease<Buffer>>

Unbinds the resource from a graph-like object. Read more
source§

impl Unbind<RenderGraph, Arc<Lease<Image>>> for ImageLeaseNode

source§

fn unbind(self, graph: &mut RenderGraph) -> Arc<Lease<Image>>

Unbinds the resource from a graph-like object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: 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.
§

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.
§

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.
§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more