pub struct RenderGraphBuilder { /* private fields */ }
Expand description

A collection of nodes and resources. Nodes represent an event or process that will occur at a certain time. (For now, they just represent subpasses that may be merged with each other.) Resources represent images and buffers that may be read/written by nodes.

Implementations§

source§

impl RenderGraphBuilder

source

pub fn create_unattached_image( &mut self, create_node: RenderGraphNodeId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Create an image but do not use it (may be passed around and used elsewhere)

source

pub fn create_color_attachment( &mut self, node: RenderGraphNodeId, color_attachment_index: usize, clear_color_value: Option<RafxColorClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Create a new image and use it as a writable color attachment in a renderpass

source

pub fn create_depth_attachment( &mut self, node: RenderGraphNodeId, clear_depth_stencil_value: Option<RafxDepthStencilClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Create a new image and use it as a writable depth attachment in a renderpass

source

pub fn create_depth_stencil_attachment( &mut self, node: RenderGraphNodeId, clear_depth_stencil_value: Option<RafxDepthStencilClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions, has_depth: bool, has_stencil: bool ) -> RenderGraphImageUsageId

Create a new image and use it as a writable depth/stencil attachment in a renderpass

source

pub fn create_resolve_attachment( &mut self, node: RenderGraphNodeId, resolve_attachment_index: usize, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Create a new image and use it as a resolve attachment in a renderpass

source

pub fn read_color_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, color_attachment_index: usize, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions )

Use the given image as a read-only color attachment in a renderpass

source

pub fn read_depth_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions )

Use the given image as a read-only depth attachment in a renderpass

source

pub fn read_depth_stencil_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions, has_depth: bool, has_stencil: bool )

Use the given image as a read-only depth/stencil attachment in a renderpass

source

pub fn modify_color_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, color_attachment_index: usize, clear_color_value: Option<RafxColorClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a writable color attachment in a renderpass

source

pub fn modify_depth_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, clear_depth_stencil_value: Option<RafxDepthStencilClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a writable depth attachment in a renderpass

source

pub fn modify_depth_stencil_attachment( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, clear_depth_stencil_value: Option<RafxDepthStencilClearValue>, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a writable depth/stencil attachment in a renderpass

source

pub fn sample_image( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a shader resource (i.e. can sample from the image) in a renderpass

source

pub fn read_vertex_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as a vertex buffer

source

pub fn read_index_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as an index buffer

source

pub fn read_indirect_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as an indirect buffer

source

pub fn read_uniform_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as a uniform buffer

source

pub fn read_copy_src_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as a copy source

source

pub fn write_copy_dst_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given buffer as a copy destination

source

pub fn read_copy_src_image( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a copy source

source

pub fn write_copy_dst_image( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given image as a copy destination

source

pub fn create_storage_buffer( &mut self, node: RenderGraphNodeId, constraint: RenderGraphBufferConstraint, load_op: RafxLoadOp ) -> RenderGraphBufferUsageId

Create a storage buffer and use it as a writable shader resource

source

pub fn read_storage_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint ) -> RenderGraphBufferUsageId

Use the given storage buffer as a read-only shader resource

source

pub fn modify_storage_buffer( &mut self, node: RenderGraphNodeId, buffer: RenderGraphBufferUsageId, constraint: RenderGraphBufferConstraint, load_op: RafxLoadOp ) -> RenderGraphBufferUsageId

Use the given storage buffer as a writable shader resource

source

pub fn create_storage_image( &mut self, node: RenderGraphNodeId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Create a storage image and use it as a writable shader resource

source

pub fn read_storage_image( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given storage image as a read-only shader resource

source

pub fn modify_storage_image( &mut self, node: RenderGraphNodeId, image: RenderGraphImageUsageId, constraint: RenderGraphImageConstraint, view_options: RenderGraphImageViewOptions ) -> RenderGraphImageUsageId

Use the given storage image as a writable shader resource

source

pub fn add_external_image( &mut self, image_resource: ResourceArc<ImageViewResource>, view_options: RenderGraphImageViewOptions, initial_state: RafxResourceState, final_state: RafxResourceState ) -> RenderGraphExternalImageId

Register a non-rendergraph image for use with the rendergraph. (Use read_external_image() or write_external_image() to access it)

source

pub fn add_external_buffer( &mut self, buffer_resource: ResourceArc<BufferResource>, initial_state: RafxResourceState, final_state: RafxResourceState ) -> RenderGraphExternalBufferId

Register a non-rendergraph buffer for use with the rendergraph. (Use read_external_buffer() or write_external_buffer() to access it)

source

pub fn read_external_image( &mut self, external_image_id: RenderGraphExternalImageId ) -> RenderGraphImageUsageId

Use an external image as an input for a render graph node

source

pub fn read_external_buffer( &mut self, external_buffer_id: RenderGraphExternalBufferId ) -> RenderGraphBufferUsageId

Use an external buffer as an input for a render graph node

source

pub fn write_external_image( &mut self, external_image_id: RenderGraphExternalImageId, image_id: RenderGraphImageUsageId )

Use an external image as an output for a render graph node

source

pub fn write_external_buffer( &mut self, external_buffer_id: RenderGraphExternalBufferId, buffer_id: RenderGraphBufferUsageId )

Use an external buffer as an output for a render graph node

source

pub fn copy_buffer_to_buffer( &mut self, name: &'static str, queue: RenderGraphQueue, src_buffer: RenderGraphBufferUsageId, dst_buffer: Option<RenderGraphBufferUsageId>, params: Option<RafxCmdCopyBufferToBufferParams> ) -> RenderGraphBufferUsageId

Schedule a GPU copy from one buffer to another. If dst_buffer is None, create a copy of the src_buffer.

source

pub fn clone_buffer( &mut self, name: &'static str, queue: RenderGraphQueue, src_buffer: RenderGraphBufferUsageId, params: Option<RafxCmdCopyBufferToBufferParams> ) -> RenderGraphBufferUsageId

Create a buffer and schedule a GPU copy from the src_buffer into it. (Shorthand for using copy_buffer_to_buffer())

source

pub fn copy_image_to_image( &mut self, name: &'static str, queue: RenderGraphQueue, src_image: RenderGraphImageUsageId, dst_image: Option<RenderGraphImageUsageId>, params: Option<RafxCmdCopyTextureToTextureParams> ) -> RenderGraphImageUsageId

Schedule a GPU copy from one image to another. If dst_image is None, create a copy of the src_image.

source

pub fn clone_image( &mut self, name: &'static str, queue: RenderGraphQueue, src_image: RenderGraphImageUsageId, params: Option<RafxCmdCopyTextureToTextureParams> ) -> RenderGraphImageUsageId

Create a image and schedule a GPU copy from the src_buffer into it. (Shorthand for using copy_image_to_image())

source

pub fn blit_image_to_image( &mut self, name: &'static str, queue: RenderGraphQueue, src_image: RenderGraphImageUsageId, src_min_uv: Vec2, src_max_uv: Vec2, dst_image: RenderGraphImageUsageId, dst_min_uv: Vec2, dst_max_uv: Vec2 ) -> RenderGraphImageUsageId

Render the src_image into the dst_image. This is less efficient than copy_image_to_image, but is more flexible. (It is essentially drawing the src_image as a quad on the dst_image)

source

pub fn add_renderpass_node( &mut self, name: &'static str, queue: RenderGraphQueue ) -> RenderGraphNodeId

source

pub fn add_callback_node( &mut self, name: &'static str, queue: RenderGraphQueue ) -> RenderGraphNodeId

source

pub fn add_node( &mut self, name: &'static str, kind: RenderGraphNodeKind, queue: RenderGraphQueue ) -> RenderGraphNodeId

source

pub fn add_node_unnamed( &mut self, kind: RenderGraphNodeKind, queue: RenderGraphQueue ) -> RenderGraphNodeId

source

pub fn set_node_required(&mut self, node_id: RenderGraphNodeId)

source

pub fn add_explicit_dependency( &mut self, before_node_id: RenderGraphNodeId, after_node_id: RenderGraphNodeId )

source

pub fn set_buffer_required(&mut self, buffer_usage: RenderGraphBufferUsageId)

source

pub fn set_image_required(&mut self, image_usage: RenderGraphImageUsageId)

source

pub fn set_node_name(&mut self, node_id: RenderGraphNodeId, name: &'static str)

source

pub fn set_image_name( &mut self, image_id: RenderGraphImageUsageId, name: RenderGraphResourceName )

source

pub fn set_buffer_name( &mut self, buffer_id: RenderGraphBufferUsageId, name: RenderGraphResourceName )

source

pub fn set_renderpass_callback<CallbackFnT>( &mut self, node_id: RenderGraphNodeId, f: CallbackFnT )
where CallbackFnT: Fn(VisitRenderpassNodeArgs<'_, '_>) -> RafxResult<()> + 'static + Send,

Adds a callback that receives the renderpass associated with the node

source

pub fn set_callback<CallbackFnT>( &mut self, node_id: RenderGraphNodeId, f: CallbackFnT )
where CallbackFnT: Fn(VisitComputeNodeArgs<'_, '_>) -> RafxResult<()> + 'static + Send,

Adds a callback for compute based nodes

source

pub fn add_render_phase_dependency<PhaseT: RenderPhase>( &mut self, node_id: RenderGraphNodeId )

source

pub fn build_plan( self, swapchain_surface_info: &SwapchainSurfaceInfo ) -> RenderGraphPlan

Trait Implementations§

source§

impl Default for RenderGraphBuilder

source§

fn default() -> RenderGraphBuilder

Returns the “default value” for a type. Read more

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> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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>,

§

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>,

§

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.