pub struct Command<'a> { /* private fields */ }Expand description
A general-purpose Vulkan command which may contain acceleration structure operations, transfers, or shader pipelines.
There are four main uses of a Command:
- Bind resources (
Self::bind_resource) - Declare resource accesses (
Self::resource_access) - Record general-purpose command buffers or acceleration structure operations
(
Self::record_cmd) - Bind shader pipelines (
Self::bind_pipeline)
When bound, a shader pipeline consumes the Command and returns a PipelineCommand which
provides command recording functions specific to each pipeline type.
Implementations§
Source§impl<'a> Command<'a>
impl<'a> Command<'a>
Sourcepub fn bind_resource<R>(&mut self, resource: R) -> R::Nodewhere
R: Resource,
pub fn bind_resource<R>(&mut self, resource: R) -> R::Nodewhere
R: Resource,
Binds a Vulkan buffer, image, or acceleration structure resource to the graph associated with this command.
Bound nodes may be used in commands for pipeline and shader operations.
Sourcepub fn bind_pipeline<P>(self, pipeline: P) -> P::Commandwhere
P: Pipeline<'a>,
pub fn bind_pipeline<P>(self, pipeline: P) -> P::Commandwhere
P: Pipeline<'a>,
Binds a shader pipeline to the current command, allowing for strongly typed access to the related functions.
Sourcepub fn debug_name(self, name: impl Into<String>) -> Self
pub fn debug_name(self, name: impl Into<String>) -> Self
Sets a debugging name, but only in debug builds.
Sourcepub fn end_cmd(self) -> &'a mut Graph
pub fn end_cmd(self) -> &'a mut Graph
Finalize the recording of this command and return to the Graph where you may record
additional commands.
Sourcepub fn record_cmd(
self,
func: impl FnOnce(CommandRef<'_>) + Send + 'static,
) -> Self
pub fn record_cmd( self, func: impl FnOnce(CommandRef<'_>) + Send + 'static, ) -> Self
Begin recording general-purpose work for this graph command.
This is the entry point for building and updating an
AccelerationStructure instance.
The provided closure allows you to run any Vulkan code, or interoperate with other Vulkan code and interfaces.
Sourcepub fn record_cmd_mut(
&mut self,
func: impl FnOnce(CommandRef<'_>) + Send + 'static,
)
pub fn record_cmd_mut( &mut self, func: impl FnOnce(CommandRef<'_>) + Send + 'static, )
Mutable-borrow form of Self::record_cmd.
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 bound resource node represents.
Sourcepub fn resource_access<N>(self, resource_node: N, access: AccessType) -> Self
pub fn resource_access<N>(self, resource_node: N, access: AccessType) -> Self
Informs the command that recorded work will read or write resource_node
using access.
An access function must be called for resource_node before it is used within a recording
function.
Sourcepub fn set_debug_name(&mut self, name: impl Into<String>) -> &mut Self
pub fn set_debug_name(&mut self, name: impl Into<String>) -> &mut Self
Mutable-borrow form of Self::debug_name.
Sourcepub fn set_resource_access<N>(&mut self, resource_node: N, access: AccessType)
pub fn set_resource_access<N>(&mut self, resource_node: N, access: AccessType)
Mutable-borrow form of Self::resource_access.
Sourcepub fn set_subresource_access<N>(
&mut self,
resource_node: N,
subresource: impl Into<N::Range>,
access: AccessType,
)
pub fn set_subresource_access<N>( &mut self, resource_node: N, subresource: impl Into<N::Range>, access: AccessType, )
Mutable-borrow form of Self::subresource_access.
Sourcepub fn subresource_access<N>(
self,
resource_node: N,
subresource: impl Into<N::Range>,
access: AccessType,
) -> Self
pub fn subresource_access<N>( self, resource_node: N, subresource: impl Into<N::Range>, access: AccessType, ) -> Self
Informs the command that recorded work will read or write the subresource of
resource_node using access.
An access function must be called for resource_node before it is used within a recording
function.