Skip to content
Snippets Groups Projects
Verified Commit eb2bd24b authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Added doxygen comments to command resources

parent da2340bf
No related branches found
No related tags found
1 merge request!97Resolve "Dokumentation vervollständigen"
...@@ -16,19 +16,94 @@ namespace vkcv { ...@@ -16,19 +16,94 @@ namespace vkcv {
std::vector<vk::CommandPool> cmdPoolPerQueueFamily; std::vector<vk::CommandPool> cmdPoolPerQueueFamily;
}; };
std::unordered_set<int> generateQueueFamilyIndexSet(const QueueManager& queueManager); /**
CommandResources createCommandResources(const vk::Device& device, const std::unordered_set<int> &familyIndexSet); * @brief Generates a set of the family indices for all different kinds of
void destroyCommandResources(const vk::Device& device, const CommandResources& resources); * queues a given queue manager provides.
vk::CommandBuffer allocateCommandBuffer(const vk::Device& device, const vk::CommandPool &cmdPool); *
vk::CommandPool chooseCmdPool(const Queue &queue, const CommandResources &cmdResources); * @param[in] queueManager Queue manager
Queue getQueueForSubmit(QueueType type, const QueueManager &queueManager); * @return Set of queue family indices
void beginCommandBuffer(const vk::CommandBuffer &cmdBuffer, vk::CommandBufferUsageFlags flags); */
std::unordered_set<int> generateQueueFamilyIndexSet(const QueueManager &queueManager);
/**
* @brief Creates and returns a new command resources instance containing
* a vector of newly allocated command pools for each different queue family
* index in a given set.
*
* @param[in,out] device Vulkan device
* @param[in] familyIndexSet Set of queue family indices
* @return New command resources
*/
CommandResources createCommandResources(const vk::Device &device,
const std::unordered_set<int> &familyIndexSet);
/**
* @brief Destroys a command resources instance and deallocates its command
* pools. The command resources will be invalid to use afterwards.
*
* @param[in,out] device Vulkan device
* @param[in,out] resources Command resources
*/
void destroyCommandResources(const vk::Device &device,
const CommandResources &resources);
/**
* @brief Allocates and returns a new primary command buffer of a given
* command pool.
*
* @param[in,out] device Vulkan device
* @param[in,out] cmdPool Vulkan command pool
* @return New vulkan command buffer
*/
vk::CommandBuffer allocateCommandBuffer(const vk::Device &device,
const vk::CommandPool &cmdPool);
/**
* @brief Returns the matching command pool of given command resources for
* a specific queue.
*
* @param[in] queue Queue
* @param[in] cmdResources Command resources
* @return Command pool for a given queue
*/
vk::CommandPool chooseCmdPool(const Queue &queue,
const CommandResources &cmdResources);
/**
* @brief Returns a queue of a given type from a queue manager.
*
* @param[in] type Type of queue
* @param[in] queueManager Queue manager
* @return Queue of a given type
*/
Queue getQueueForSubmit(QueueType type,
const QueueManager &queueManager);
/**
* @brief Begins the usage of a command buffer with given command buffer
* usage flags.
*
* @param[in] cmdBuffer Vulkan command buffer
* @param[in] flags Command buffer usage flags
*/
void beginCommandBuffer(const vk::CommandBuffer &cmdBuffer,
vk::CommandBufferUsageFlags flags);
void submitCommandBufferToQueue( /**
vk::Queue queue, * @brief Submits a command buffer into a queue with given fence and
vk::CommandBuffer cmdBuffer, * semaphores to wait for or to signal after processing the command
vk::Fence fence, * buffer.
const std::vector<vk::Semaphore>& waitSemaphores, *
const std::vector<vk::Semaphore>& signalSemaphores); * @param[in,out] queue Vulkan queue
* @param[in] cmdBuffer Vulkan command buffer
* @param[in] fence Vulkan fence to wait for
* @param[in] waitSemaphores Vector of semaphores to wait for
* @param[in] signalSemaphores Vector of semaphores to signal
*/
void submitCommandBufferToQueue(vk::Queue queue,
const vk::CommandBuffer &cmdBuffer,
const vk::Fence &fence,
const std::vector<vk::Semaphore>& waitSemaphores,
const std::vector<vk::Semaphore>& signalSemaphores);
} }
\ No newline at end of file
...@@ -75,10 +75,10 @@ namespace vkcv { ...@@ -75,10 +75,10 @@ namespace vkcv {
void submitCommandBufferToQueue( void submitCommandBufferToQueue(
vk::Queue queue, vk::Queue queue,
vk::CommandBuffer cmdBuffer, const vk::CommandBuffer &cmdBuffer,
vk::Fence fence, const vk::Fence &fence,
const std::vector<vk::Semaphore>& waitSemaphores, const std::vector<vk::Semaphore> &waitSemaphores,
const std::vector<vk::Semaphore>& signalSemaphores) { const std::vector<vk::Semaphore> &signalSemaphores) {
const std::vector<vk::PipelineStageFlags> waitDstStageMasks(waitSemaphores.size(), vk::PipelineStageFlagBits::eAllCommands); const std::vector<vk::PipelineStageFlags> waitDstStageMasks(waitSemaphores.size(), vk::PipelineStageFlagBits::eAllCommands);
const vk::SubmitInfo queueSubmitInfo(waitSemaphores, waitDstStageMasks, cmdBuffer, signalSemaphores); const vk::SubmitInfo queueSubmitInfo(waitSemaphores, waitDstStageMasks, cmdBuffer, signalSemaphores);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment