Manages the command pool, frame command buffers, and one-time utility command buffer operations.
More...
#include <VulkanCommandManager.hpp>
|
| VkDevice | device = VK_NULL_HANDLE |
| | Reference to Vulkan logical device.
|
| VkCommandPool | commandPool = VK_NULL_HANDLE |
| | Raw command pool handle.
|
| std::vector< VkCommandBuffer > | commandBuffers |
| | Array of primary frame command buffers.
|
| size_t | currentFrame = 0 |
| | Active frame command buffer array index.
|
Manages the command pool, frame command buffers, and one-time utility command buffer operations.
◆ VulkanCommandManager() [1/2]
| VulkanCommandManager::VulkanCommandManager |
( |
| ) |
|
|
default |
Construct a new Vulkan Command Manager object.
◆ ~VulkanCommandManager()
| VulkanCommandManager::~VulkanCommandManager |
( |
| ) |
|
Destroy the Vulkan Command Manager object and release command pool.
Destroy the Vulkan Command Manager:: Vulkan Command Manager object.
◆ VulkanCommandManager() [2/2]
◆ beginFrame()
| void VulkanCommandManager::beginFrame |
( |
| ) |
|
Alternates the frame index and begins recording the next frame command buffer.
Steps frame index and begins recording next frame command buffer.
◆ beginOneTimeCommand()
| VkCommandBuffer VulkanCommandManager::beginOneTimeCommand |
( |
| ) |
|
Allocates and begins recording a one-time utility command buffer.
Allocates and starts recording a one-time utility command buffer.
- Returns
- Allocated VkCommandBuffer handle.
-
Allocated command buffer.
◆ create()
| void VulkanCommandManager::create |
( |
VkDevice | dev, |
|
|
uint32_t | queueFamilyIndex, |
|
|
uint32_t | commandBufferCount = 2 ) |
Creates command pool and command buffers.
Instantiates the command pool and primary command buffers.
- Parameters
-
| device | Vulkan logical device context. |
| queueFamilyIndex | Index of the target hardware queue family. |
| commandBufferCount | Number of primary frame buffers to allocate. |
| dev | Logical device context. |
| queueFamilyIndex | Graphics queue family location index. |
| commandBufferCount | Number of primary command buffers. |
◆ destroy()
| void VulkanCommandManager::destroy |
( |
| ) |
|
Safely destroys the command pool and associated command buffers.
Destroys the Vulkan command pool.
◆ endFrame()
| void VulkanCommandManager::endFrame |
( |
| ) |
|
Ends command buffer recording for the active frame.
Ends frame command buffer recording.
◆ endOneTimeCommand()
| void VulkanCommandManager::endOneTimeCommand |
( |
VkCommandBuffer | commandBuffer, |
|
|
VkQueue | queue ) |
Ends, submits, waits on, and releases a one-time utility command buffer.
Submits, waits on, and frees a one-time utility command buffer.
- Parameters
-
| commandBuffer | The temporary command buffer. |
| queue | Queue to submit commands to. |
| commandBuffer | Temporary command buffer handle. |
| queue | Command target queue. |
◆ getCommandBuffer()
| VkCommandBuffer VulkanCommandManager::getCommandBuffer |
( |
size_t | index | ) |
const |
|
inline |
Gets command buffer at specified array index.
- Parameters
-
- Returns
- VkCommandBuffer handle.
◆ getCommandPool()
| VkCommandPool VulkanCommandManager::getCommandPool |
( |
| ) |
const |
|
inline |
Gets raw Vulkan command pool.
- Returns
- VkCommandPool handle.
◆ getCurrentCommandBuffer()
| VkCommandBuffer VulkanCommandManager::getCurrentCommandBuffer |
( |
| ) |
const |
|
inline |
Gets command buffer corresponding to current frame index.
- Returns
- VkCommandBuffer handle.
◆ getCurrentFrame()
| size_t VulkanCommandManager::getCurrentFrame |
( |
| ) |
const |
|
inline |
Gets active double buffering frame index.
- Returns
- Frame index.
◆ operator=()
◆ commandBuffers
| std::vector<VkCommandBuffer> VulkanCommandManager::commandBuffers |
|
private |
Array of primary frame command buffers.
◆ commandPool
| VkCommandPool VulkanCommandManager::commandPool = VK_NULL_HANDLE |
|
private |
◆ currentFrame
| size_t VulkanCommandManager::currentFrame = 0 |
|
private |
Active frame command buffer array index.
◆ device
| VkDevice VulkanCommandManager::device = VK_NULL_HANDLE |
|
private |
Reference to Vulkan logical device.
The documentation for this class was generated from the following files: