Struct screen_13::graph::RenderGraph
source · 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
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 !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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.