pub struct Graph { /* private fields */ }Expand description
A composable graph of Vulkan command buffer operations.
Graph instances are are intended for one-time use.
The design of this code originated with a combination of
PassBuilder
and
graph.cpp.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn bind_resource<R>(&mut self, resource: R) -> R::Nodewhere
R: Resource,
pub fn bind_resource<R>(&mut self, resource: R) -> R::Nodewhere
R: Resource,
Binds a Vulkan buffer, image, or acceleration structure resource to this graph.
Bound resource nodes may be used in commands for shader pipeline operations and other general functions.
Sourcepub fn blit_image(
&mut self,
src: impl Into<AnyImageNode>,
dst: impl Into<AnyImageNode>,
filter: Filter,
) -> &mut Self
pub fn blit_image( &mut self, src: impl Into<AnyImageNode>, dst: impl Into<AnyImageNode>, filter: Filter, ) -> &mut Self
Copy an image, potentially performing format conversion.
Sourcepub fn blit_image_region(
&mut self,
src: impl Into<AnyImageNode>,
dst: impl Into<AnyImageNode>,
filter: Filter,
regions: impl AsRef<[ImageBlit]> + 'static + Send,
) -> &mut Self
pub fn blit_image_region( &mut self, src: impl Into<AnyImageNode>, dst: 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: impl Into<AnyImageNode>,
color: impl Into<ClearColorValue>,
) -> &mut Self
pub fn clear_color_image( &mut self, image: impl Into<AnyImageNode>, color: impl Into<ClearColorValue>, ) -> &mut Self
Clear a color image.
Sourcepub fn clear_depth_stencil_image(
&mut self,
image: impl Into<AnyImageNode>,
depth: f32,
stencil: u32,
) -> &mut Self
pub fn clear_depth_stencil_image( &mut self, image: impl Into<AnyImageNode>, depth: f32, stencil: u32, ) -> &mut Self
Clears a depth/stencil image.
Sourcepub fn copy_buffer(
&mut self,
src: impl Into<AnyBufferNode>,
dst: impl Into<AnyBufferNode>,
) -> &mut Self
pub fn copy_buffer( &mut self, src: impl Into<AnyBufferNode>, dst: impl Into<AnyBufferNode>, ) -> &mut Self
Copy data between buffers
Sourcepub fn copy_buffer_region(
&mut self,
src: impl Into<AnyBufferNode>,
dst: impl Into<AnyBufferNode>,
regions: impl AsRef<[BufferCopy]> + 'static + Send,
) -> &mut Self
pub fn copy_buffer_region( &mut self, src: impl Into<AnyBufferNode>, dst: 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: impl Into<AnyBufferNode>,
dst: impl Into<AnyImageNode>,
) -> &mut Self
pub fn copy_buffer_to_image( &mut self, src: impl Into<AnyBufferNode>, dst: impl Into<AnyImageNode>, ) -> &mut Self
Copy data from a buffer into an image.
Sourcepub fn copy_buffer_to_image_region(
&mut self,
src: impl Into<AnyBufferNode>,
dst: impl Into<AnyImageNode>,
regions: impl AsRef<[BufferImageCopy]> + 'static + Send,
) -> &mut Self
pub fn copy_buffer_to_image_region( &mut self, src: impl Into<AnyBufferNode>, dst: 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: impl Into<AnyImageNode>,
dst: impl Into<AnyImageNode>,
) -> &mut Self
pub fn copy_image( &mut self, src: impl Into<AnyImageNode>, dst: impl Into<AnyImageNode>, ) -> &mut Self
Copy all layers of a source image to a destination image.
Sourcepub fn copy_image_region(
&mut self,
src: impl Into<AnyImageNode>,
dst: impl Into<AnyImageNode>,
regions: impl AsRef<[ImageCopy]> + 'static + Send,
) -> &mut Self
pub fn copy_image_region( &mut self, src: impl Into<AnyImageNode>, dst: impl Into<AnyImageNode>, regions: impl AsRef<[ImageCopy]> + 'static + Send, ) -> &mut Self
Copy data between images.
Sourcepub fn copy_image_to_buffer(
&mut self,
src: impl Into<AnyImageNode>,
dst: impl Into<AnyBufferNode>,
) -> &mut Self
pub fn copy_image_to_buffer( &mut self, src: impl Into<AnyImageNode>, dst: impl Into<AnyBufferNode>, ) -> &mut Self
Copy image data into a buffer.
Sourcepub fn copy_image_to_buffer_region(
&mut self,
src: impl Into<AnyImageNode>,
dst: impl Into<AnyBufferNode>,
regions: impl AsRef<[BufferImageCopy]> + 'static + Send,
) -> &mut Self
pub fn copy_image_to_buffer_region( &mut self, src: impl Into<AnyImageNode>, dst: impl Into<AnyBufferNode>, regions: impl AsRef<[BufferImageCopy]> + 'static + Send, ) -> &mut Self
Copy image data into a buffer.
Sourcepub fn fill_buffer(
&mut self,
buffer: impl Into<AnyBufferNode>,
region: Range<DeviceSize>,
data: u32,
) -> &mut Self
pub fn fill_buffer( &mut self, buffer: impl Into<AnyBufferNode>, region: Range<DeviceSize>, data: u32, ) -> &mut Self
Fill a region of a buffer with a fixed value.
Sourcepub fn into_submission(self) -> Submission
pub fn into_submission(self) -> Submission
Finalizes the graph and provides an object with functions for submitting the resulting commands.
Sourcepub fn resource<N>(&self, resource_node: N) -> &N::Resourcewhere
N: Node,
pub fn resource<N>(&self, resource_node: N) -> &N::Resourcewhere
N: Node,
Returns a borrow of the original Vulkan resource (buffer, image or acceleration structure) which the given bound resource node represents.
Sourcepub fn update_buffer(
&mut self,
buffer: impl Into<AnyBufferNode>,
offset: DeviceSize,
data: impl AsRef<[u8]> + 'static + Send,
) -> &mut Self
pub fn update_buffer( &mut self, buffer: impl Into<AnyBufferNode>, offset: DeviceSize, data: impl AsRef<[u8]> + 'static + Send, ) -> &mut Self
Note: data must not exceed 65536 bytes.