Struct ccthw::graphics::vulkan_api::raii::CommandPool
source · pub struct CommandPool { /* private fields */ }
Expand description
RAII Vulkan CommandPool.
Implementations§
source§impl CommandPool
impl CommandPool
sourcepub unsafe fn new(
render_device: Arc<RenderDevice>,
create_info: &CommandPoolCreateInfo
) -> Result<Self, GraphicsError>
pub unsafe fn new( render_device: Arc<RenderDevice>, create_info: &CommandPoolCreateInfo ) -> Result<Self, GraphicsError>
Create a new Vulkan command pool.
Safety
Unsafe because:
- command pools must be destroyed before the Vulkan device is dropped.
sourcepub fn set_debug_name(&self, name: impl Into<String>)
pub fn set_debug_name(&self, name: impl Into<String>)
Set the name which shows up in Vulkan debug logs for this resource.
sourcepub fn primary_command_buffer(&self, index: usize) -> CommandBuffer
pub fn primary_command_buffer(&self, index: usize) -> CommandBuffer
Get the n’th primary command buffer allocated by this pool.
Note: The command pool destroys all allocated buffers when it is dropped. The caller must ensure that no command buffers are kept around after the pool is dropped.
sourcepub fn secondary_command_buffer(&self, index: usize) -> CommandBuffer
pub fn secondary_command_buffer(&self, index: usize) -> CommandBuffer
Get the n’th secondary command buffer allocated by this pool.
Note: The command pool destroys all allocated buffers when it is dropped. The caller must ensure that no command buffers are kept around after the pool is dropped.
sourcepub fn allocate_primary_command_buffers(
&mut self,
count: u32
) -> Result<usize, GraphicsError>
pub fn allocate_primary_command_buffers( &mut self, count: u32 ) -> Result<usize, GraphicsError>
Allocate primary command buffers from this pool.
Returns
Returns the index of the first newly allocated command buffer.
sourcepub fn allocate_secondary_command_buffers(
&mut self,
count: u32
) -> Result<usize, GraphicsError>
pub fn allocate_secondary_command_buffers( &mut self, count: u32 ) -> Result<usize, GraphicsError>
Allocate primary command buffers from this pool.
Returns
Returns the index of the first newly allocated command buffer.
sourcepub fn raw(&self) -> CommandPool
pub fn raw(&self) -> CommandPool
Get the raw Vulkan command pool handle.
Trait Implementations§
source§impl Debug for CommandPool
impl Debug for CommandPool
Auto Trait Implementations§
impl RefUnwindSafe for CommandPool
impl !Send for CommandPool
impl !Sync for CommandPool
impl Unpin for CommandPool
impl UnwindSafe for CommandPool
Blanket Implementations§
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.