pub struct Submission { /* private fields */ }Expand description
A structure which can optimize and submit Graph instances.
This pattern was derived from:
http://themaister.net/blog/2017/08/15/render-graphs-and-vulkan-a-deep-dive/ https://github.com/EmbarkStudios/kajiya
Implementations§
Source§impl Submission
impl Submission
Sourcepub fn is_submitted(&self) -> bool
pub fn is_submitted(&self) -> bool
Returns true when all recorded passes have been submitted to a driver command buffer.
A fully-resolved graph contains no additional work and may be discarded, although doing so will stall the GPU while the fences are waited on. It is preferrable to wait a few frame so that the fences will have already been signalled.
Sourcepub fn node_stages(&self, node: impl Node) -> PipelineStageFlags
pub fn node_stages(&self, node: impl Node) -> PipelineStageFlags
Returns the stages that process the given node.
Note that this value must be retrieved before resolving a node as there will be no data left to inspect afterwards!
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 node represents.
Sourcepub fn queue_submit<P>(
self,
pool: &mut P,
queue_family_index: u32,
queue_index: u32,
) -> Result<Lease<CommandBuffer>, DriverError>where
P: Pool<CommandBufferInfo, CommandBuffer> + Pool<DescriptorPoolInfo, DescriptorPool> + Pool<RenderPassInfo, RenderPass>,
pub fn queue_submit<P>(
self,
pool: &mut P,
queue_family_index: u32,
queue_index: u32,
) -> Result<Lease<CommandBuffer>, DriverError>where
P: Pool<CommandBufferInfo, CommandBuffer> + Pool<DescriptorPoolInfo, DescriptorPool> + Pool<RenderPassInfo, RenderPass>,
Submits the remaining commands stored in this instance.
Sourcepub fn submit_cmd_buf<P>(
&mut self,
pool: &mut P,
cmd: &mut CommandBuffer,
) -> Result<(), DriverError>
pub fn submit_cmd_buf<P>( &mut self, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
Records any pending render graph passes that have not been previously scheduled.
Sourcepub fn queue_resource<P>(
&mut self,
resource_node: impl Node,
pool: &mut P,
cmd: &mut CommandBuffer,
) -> Result<(), DriverError>
pub fn queue_resource<P>( &mut self, resource_node: impl Node, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
Records any pending render graph passes that the given node requires.
Sourcepub fn queue_resource_dependencies<P>(
&mut self,
resource_node: impl Node,
pool: &mut P,
cmd: &mut CommandBuffer,
) -> Result<(), DriverError>
pub fn queue_resource_dependencies<P>( &mut self, resource_node: impl Node, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
Records any pending render graph passes that are required by the given node, but does not record any passes that actually contain the given node.
As a side effect, the graph is optimized for the given node. Future calls may further optimize the graph, but only on top of the existing optimizations. This only matters if you are pulling multiple images out and you care - in that case pull the “most important” image first.