nngn
Loading...
Searching...
No Matches
nngn::CommandPool Class Reference

#include <cmd_pool.h>

Public Member Functions

 CommandPool ()=default
 
 ~CommandPool ()
 
 CommandPool (const CommandPool &rhs)=delete
 
CommandPooloperator= (const CommandPool &rhs)=delete
 
 CommandPool (CommandPool &&rhs) noexcept
 
CommandPooloperator= (CommandPool &&rhs) noexcept
 
VkCommandPool id () const
 
std::span< const VkCommandBufferbuffers () const
 
bool init (VkDevice dev, std::uint32_t queue_family, VkCommandPoolCreateFlagBits flags={})
 
bool alloc (std::size_t n)
 Allocates n command buffers, which are appended to buffers.
 
bool realloc (std::size_t n)
 Resets the pool and allocates n command buffers.
 
void reset ()
 
void free ()
 Deallocates and frees all commands allocated from the pool.
 

Private Member Functions

bool alloc (std::size_t n, VkCommandBuffer *p)
 
void free (std::size_t n, VkCommandBuffer *p)
 

Private Attributes

VkDevice dev = {}
 
VkCommandPool h = {}
 
std::vector< VkCommandBufferm_buffers = {}
 

Constructor & Destructor Documentation

◆ CommandPool() [1/3]

nngn::CommandPool::CommandPool ( )
default

◆ ~CommandPool()

nngn::CommandPool::~CommandPool ( )

◆ CommandPool() [2/3]

nngn::CommandPool::CommandPool ( const CommandPool & rhs)
delete

◆ CommandPool() [3/3]

nngn::CommandPool::CommandPool ( CommandPool && rhs)
inlinenoexcept

Member Function Documentation

◆ alloc() [1/2]

bool nngn::CommandPool::alloc ( std::size_t n)

Allocates n command buffers, which are appended to buffers.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc() [2/2]

bool nngn::CommandPool::alloc ( std::size_t n,
VkCommandBuffer * p )
private
Here is the call graph for this function:

◆ buffers()

std::span< const VkCommandBuffer > nngn::CommandPool::buffers ( ) const
inline

◆ free() [1/2]

void nngn::CommandPool::free ( )

Deallocates and frees all commands allocated from the pool.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free() [2/2]

void nngn::CommandPool::free ( std::size_t n,
VkCommandBuffer * p )
private

◆ id()

VkCommandPool nngn::CommandPool::id ( ) const
inline

◆ init()

bool nngn::CommandPool::init ( VkDevice dev,
std::uint32_t queue_family,
VkCommandPoolCreateFlagBits flags = {} )
Here is the call graph for this function:

◆ operator=() [1/2]

CommandPool & nngn::CommandPool::operator= ( CommandPool && rhs)
inlinenoexcept

◆ operator=() [2/2]

CommandPool & nngn::CommandPool::operator= ( const CommandPool & rhs)
delete

◆ realloc()

bool nngn::CommandPool::realloc ( std::size_t n)

Resets the pool and allocates n command buffers.

Here is the call graph for this function:

◆ reset()

void nngn::CommandPool::reset ( )
Here is the caller graph for this function:

Member Data Documentation

◆ dev

VkDevice nngn::CommandPool::dev = {}
private

◆ h

VkCommandPool nngn::CommandPool::h = {}
private

◆ m_buffers

std::vector<VkCommandBuffer> nngn::CommandPool::m_buffers = {}
private

The documentation for this class was generated from the following files: