Skip to main content

Submission

Struct Submission 

Source
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

Source

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.

Source

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!

Source

pub fn resource<N>(&self, resource_node: N) -> &N::Resource
where N: Node,

Returns a borrow of the original Vulkan resource (buffer, image or acceleration structure) which the given node represents.

Source

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.

Source

pub fn submit_cmd_buf<P>( &mut self, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
where P: Pool<DescriptorPoolInfo, DescriptorPool> + Pool<RenderPassInfo, RenderPass>,

Records any pending render graph passes that have not been previously scheduled.

Source

pub fn queue_resource<P>( &mut self, resource_node: impl Node, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
where P: Pool<DescriptorPoolInfo, DescriptorPool> + Pool<RenderPassInfo, RenderPass>,

Records any pending render graph passes that the given node requires.

Source

pub fn queue_resource_dependencies<P>( &mut self, resource_node: impl Node, pool: &mut P, cmd: &mut CommandBuffer, ) -> Result<(), DriverError>
where P: Pool<DescriptorPoolInfo, DescriptorPool> + Pool<RenderPassInfo, RenderPass>,

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.

Trait Implementations§

Source§

impl Debug for Submission

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Graph> for Submission

Source§

fn from(val: Graph) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.