Skip to main content

Module node

Module node 

Source
Expand description

Handles for Vulkan smart-pointer resources.

When you bind a resource to a Graph, you get back a node handle:

let buf_node: BufferNode = graph.bind_resource(my_buffer);
let img_node: ImageNode   = graph.bind_resource(my_image);

These handles are then passed to command-building methods like resource_access or shader_resource_access.

§Node kinds

HandleResource typeUse case
BufferNodeOwned BufferMost common
ImageNodeOwned ImageMost common
AccelerationStructureNodeOwned AccelerationStructureRay tracing
SwapchainImageNodeSwapchainImageSwapchain presentation
BufferLeaseNode, ImageLeaseNode, AccelerationStructureLeaseNodePool-leased resourcePool-based allocation
AnyBufferNode, AnyImageNode, AnyAccelerationStructureNodeAny of the aboveHeterogeneous collections

For most users, BufferNode and ImageNode are all you need. The Lease and Any* variants exist for advanced pooling and dynamic dispatch scenarios.

When borrowing resources back out of a graph with Graph::resource, concrete node types return the exact stored handle type, while Any* node types return a borrow of the underlying resource. For example, BufferNode yields &Arc<Buffer>, but AnyBufferNode yields &Buffer.

Structs§

AccelerationStructureLeaseNode
A graph-local handle for a bound resource.
AccelerationStructureNode
A graph-local handle for a bound resource.
BufferLeaseNode
A graph-local handle for a bound resource.
BufferNode
A graph-local handle for a bound resource.
ImageLeaseNode
A graph-local handle for a bound resource.
ImageNode
A graph-local handle for a bound resource.
SwapchainImageNode
A graph-local handle for a bound resource.

Enums§

AnyAccelerationStructureNode
Specifies either an owned acceleration structure or one obtained from a pool.
AnyBufferNode
Specifies either an owned buffer or one obtained from a pool.
AnyImageNode
Specifies either an owned image or one obtained from a pool.
AnyNode
A type-erased graph node for any buffer, image, or acceleration structure.