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: boolSet to true (when in debug mode) in order to get a breakpoint hit where you want.
Implementations§
Source§impl RenderGraph
impl RenderGraph
Sourcepub fn begin_pass(&mut self, name: impl AsRef<str>) -> PassRef<'_>
pub fn begin_pass(&mut self, name: impl AsRef<str>) -> PassRef<'_>
Begins a new pass.
Sourcepub fn bind_node<'a, B>(&'a mut self, binding: B) -> <B as Edge<Self>>::Resultwhere
B: Edge<Self> + Bind<&'a mut Self, <B as Edge<Self>>::Result>,
pub fn bind_node<'a, B>(&'a mut self, binding: B) -> <B as Edge<Self>>::Resultwhere
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.
Sourcepub fn blit_image(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyImageNode>,
filter: Filter,
) -> &mut Self
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.
Sourcepub fn blit_image_region(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyImageNode>,
filter: Filter,
region: ImageBlit,
) -> &mut Self
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.
Sourcepub 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
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.
Sourcepub fn clear_color_image(
&mut self,
image_node: impl Into<AnyImageNode>,
) -> &mut Self
pub fn clear_color_image( &mut self, image_node: impl Into<AnyImageNode>, ) -> &mut Self
Clear a color image.
Sourcepub fn clear_color_image_value(
&mut self,
image_node: impl Into<AnyImageNode>,
color_value: impl Into<ClearColorValue>,
) -> &mut Self
pub fn clear_color_image_value( &mut self, image_node: impl Into<AnyImageNode>, color_value: impl Into<ClearColorValue>, ) -> &mut Self
Clear a color image.
Sourcepub fn clear_depth_stencil_image(
&mut self,
image_node: impl Into<AnyImageNode>,
) -> &mut Self
pub fn clear_depth_stencil_image( &mut self, image_node: impl Into<AnyImageNode>, ) -> &mut Self
Clears a depth/stencil image.
Sourcepub fn clear_depth_stencil_image_value(
&mut self,
image_node: impl Into<AnyImageNode>,
depth: f32,
stencil: u32,
) -> &mut Self
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.
Sourcepub fn copy_buffer(
&mut self,
src_node: impl Into<AnyBufferNode>,
dst_node: impl Into<AnyBufferNode>,
) -> &mut Self
pub fn copy_buffer( &mut self, src_node: impl Into<AnyBufferNode>, dst_node: impl Into<AnyBufferNode>, ) -> &mut Self
Copy data between buffers
Sourcepub fn copy_buffer_region(
&mut self,
src_node: impl Into<AnyBufferNode>,
dst_node: impl Into<AnyBufferNode>,
region: BufferCopy,
) -> &mut Self
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.
Sourcepub fn copy_buffer_regions(
&mut self,
src_node: impl Into<AnyBufferNode>,
dst_node: impl Into<AnyBufferNode>,
regions: impl AsRef<[BufferCopy]> + 'static + Send,
) -> &mut Self
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.
Sourcepub fn copy_buffer_to_image(
&mut self,
src_node: impl Into<AnyBufferNode>,
dst_node: impl Into<AnyImageNode>,
) -> &mut Self
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.
Sourcepub fn copy_buffer_to_image_region(
&mut self,
src_node: impl Into<AnyBufferNode>,
dst_node: impl Into<AnyImageNode>,
region: BufferImageCopy,
) -> &mut Self
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.
Sourcepub 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
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.
Sourcepub fn copy_image(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyImageNode>,
) -> &mut Self
pub fn copy_image( &mut self, src_node: impl Into<AnyImageNode>, dst_node: impl Into<AnyImageNode>, ) -> &mut Self
Copy data between images.
Sourcepub fn copy_image_region(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyImageNode>,
region: ImageCopy,
) -> &mut Self
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.
Sourcepub fn copy_image_regions(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyImageNode>,
regions: impl AsRef<[ImageCopy]> + 'static + Send,
) -> &mut Self
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.
Sourcepub fn copy_image_to_buffer(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyBufferNode>,
) -> &mut Self
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.
Sourcepub fn copy_image_to_buffer_region(
&mut self,
src_node: impl Into<AnyImageNode>,
dst_node: impl Into<AnyBufferNode>,
region: BufferImageCopy,
) -> &mut Self
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.
Sourcepub 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
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.
Sourcepub fn fill_buffer(
&mut self,
buffer_node: impl Into<AnyBufferNode>,
data: u32,
) -> &mut Self
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.
Sourcepub fn fill_buffer_region(
&mut self,
buffer_node: impl Into<AnyBufferNode>,
data: u32,
region: Range<DeviceSize>,
) -> &mut Self
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.
Sourcepub fn node_device_address(
&self,
node: impl Into<AnyBufferNode>,
) -> DeviceAddress
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.
Sourcepub fn node_info<N>(&self, node: N) -> <N as Information>::Infowhere
N: Information,
pub fn node_info<N>(&self, node: N) -> <N as Information>::Infowhere
N: Information,
Returns information used to crate a node.
Sourcepub fn resolve(self) -> Resolver
pub fn resolve(self) -> Resolver
Finalizes the graph and provides an object with functions for submitting the resulting commands.
Sourcepub fn unbind_node<N>(&mut self, node: N) -> <N as Edge<Self>>::Resultwhere
N: Edge<Self> + Unbind<Self, <N as Edge<Self>>::Result>,
pub fn unbind_node<N>(&mut self, node: N) -> <N as Edge<Self>>::Resultwhere
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.
Sourcepub fn update_buffer(
&mut self,
buffer_node: impl Into<AnyBufferNode>,
data: impl AsRef<[u8]> + 'static + Send,
) -> &mut Self
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.
Sourcepub fn update_buffer_offset(
&mut self,
buffer_node: impl Into<AnyBufferNode>,
offset: DeviceSize,
data: impl AsRef<[u8]> + 'static + Send,
) -> &mut Self
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>>
impl<'a> Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for &'a Arc<Lease<AccelerationStructure>>
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
Source§impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Arc<Lease<AccelerationStructure>>
impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Arc<Lease<AccelerationStructure>>
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
Source§impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Lease<AccelerationStructure>
impl Bind<&mut RenderGraph, AccelerationStructureLeaseNode> for Lease<AccelerationStructure>
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureLeaseNode
Source§impl<'a> Bind<&mut RenderGraph, AccelerationStructureNode> for &'a Arc<AccelerationStructure>
impl<'a> Bind<&mut RenderGraph, AccelerationStructureNode> for &'a Arc<AccelerationStructure>
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
Source§impl Bind<&mut RenderGraph, AccelerationStructureNode> for AccelerationStructure
impl Bind<&mut RenderGraph, AccelerationStructureNode> for AccelerationStructure
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
Source§impl Bind<&mut RenderGraph, AccelerationStructureNode> for Arc<AccelerationStructure>
impl Bind<&mut RenderGraph, AccelerationStructureNode> for Arc<AccelerationStructure>
Source§fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
fn bind(self, graph: &mut RenderGraph) -> AccelerationStructureNode
Source§impl<'a> Bind<&mut RenderGraph, BufferLeaseNode> for &'a Arc<Lease<Buffer>>
impl<'a> Bind<&mut RenderGraph, BufferLeaseNode> for &'a Arc<Lease<Buffer>>
Source§fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
Source§impl Bind<&mut RenderGraph, BufferLeaseNode> for Arc<Lease<Buffer>>
impl Bind<&mut RenderGraph, BufferLeaseNode> for Arc<Lease<Buffer>>
Source§fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
Source§impl Bind<&mut RenderGraph, BufferLeaseNode> for Lease<Buffer>
impl Bind<&mut RenderGraph, BufferLeaseNode> for Lease<Buffer>
Source§fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
fn bind(self, graph: &mut RenderGraph) -> BufferLeaseNode
Source§impl<'a> Bind<&mut RenderGraph, BufferNode> for &'a Arc<Buffer>
impl<'a> Bind<&mut RenderGraph, BufferNode> for &'a Arc<Buffer>
Source§fn bind(self, graph: &mut RenderGraph) -> BufferNode
fn bind(self, graph: &mut RenderGraph) -> BufferNode
Source§impl Bind<&mut RenderGraph, BufferNode> for Arc<Buffer>
impl Bind<&mut RenderGraph, BufferNode> for Arc<Buffer>
Source§fn bind(self, graph: &mut RenderGraph) -> BufferNode
fn bind(self, graph: &mut RenderGraph) -> BufferNode
Source§impl Bind<&mut RenderGraph, BufferNode> for Buffer
impl Bind<&mut RenderGraph, BufferNode> for Buffer
Source§fn bind(self, graph: &mut RenderGraph) -> BufferNode
fn bind(self, graph: &mut RenderGraph) -> BufferNode
Source§impl<'a> Bind<&mut RenderGraph, ImageLeaseNode> for &'a Arc<Lease<Image>>
impl<'a> Bind<&mut RenderGraph, ImageLeaseNode> for &'a Arc<Lease<Image>>
Source§fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
Source§impl Bind<&mut RenderGraph, ImageLeaseNode> for Arc<Lease<Image>>
impl Bind<&mut RenderGraph, ImageLeaseNode> for Arc<Lease<Image>>
Source§fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
Source§impl Bind<&mut RenderGraph, ImageLeaseNode> for Lease<Image>
impl Bind<&mut RenderGraph, ImageLeaseNode> for Lease<Image>
Source§fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
fn bind(self, graph: &mut RenderGraph) -> ImageLeaseNode
Source§impl Bind<&mut RenderGraph, SwapchainImageNode> for SwapchainImage
impl Bind<&mut RenderGraph, SwapchainImageNode> for SwapchainImage
Source§fn bind(self, graph: &mut RenderGraph) -> SwapchainImageNode
fn bind(self, graph: &mut RenderGraph) -> SwapchainImageNode
Source§impl Debug for RenderGraph
impl Debug for RenderGraph
Source§impl Unbind<RenderGraph, Arc<AccelerationStructure>> for AccelerationStructureNode
impl Unbind<RenderGraph, Arc<AccelerationStructure>> for AccelerationStructureNode
Source§fn unbind(self, graph: &mut RenderGraph) -> Arc<AccelerationStructure>
fn unbind(self, graph: &mut RenderGraph) -> Arc<AccelerationStructure>
Source§impl Unbind<RenderGraph, Arc<Buffer>> for BufferNode
impl Unbind<RenderGraph, Arc<Buffer>> for BufferNode
Source§impl Unbind<RenderGraph, Arc<Lease<AccelerationStructure>>> for AccelerationStructureLeaseNode
impl Unbind<RenderGraph, Arc<Lease<AccelerationStructure>>> for AccelerationStructureLeaseNode
Source§fn unbind(self, graph: &mut RenderGraph) -> Arc<Lease<AccelerationStructure>>
fn unbind(self, graph: &mut RenderGraph) -> Arc<Lease<AccelerationStructure>>
Source§impl Unbind<RenderGraph, Arc<Lease<Buffer>>> for BufferLeaseNode
impl Unbind<RenderGraph, Arc<Lease<Buffer>>> for BufferLeaseNode
Auto Trait Implementations§
impl Freeze for RenderGraph
impl !RefUnwindSafe for RenderGraph
impl Send for RenderGraph
impl !Sync for RenderGraph
impl Unpin 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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.