From d566e90a228c8867f08b9f186e427deabeddca07 Mon Sep 17 00:00:00 2001 From: Tobias Frisch <tfrisch@uni-koblenz.de> Date: Tue, 24 May 2022 14:28:58 +0200 Subject: [PATCH] Added more doxygen comments to multiple classes Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de> --- include/vkcv/Buffer.hpp | 5 + include/vkcv/BufferManager.hpp | 4 + .../vkcv/CommandRecordingFunctionTypes.hpp | 7 ++ include/vkcv/CommandResources.hpp | 4 + include/vkcv/ComputePipelineConfig.hpp | 3 + include/vkcv/Context.hpp | 8 ++ include/vkcv/Core.hpp | 4 + include/vkcv/DescriptorWrites.hpp | 97 +++++++++++++++++++ include/vkcv/GraphicsPipelineConfig.hpp | 5 +- 9 files changed, 136 insertions(+), 1 deletion(-) diff --git a/include/vkcv/Buffer.hpp b/include/vkcv/Buffer.hpp index 61d4a97b..a3784087 100644 --- a/include/vkcv/Buffer.hpp +++ b/include/vkcv/Buffer.hpp @@ -12,6 +12,11 @@ namespace vkcv { + /** + * @brief Template class for buffer management and filling data. + * + * @tparam T Buffer content type + */ template<typename T> class Buffer { friend class Core; diff --git a/include/vkcv/BufferManager.hpp b/include/vkcv/BufferManager.hpp index 6f197d12..c66e66ed 100644 --- a/include/vkcv/BufferManager.hpp +++ b/include/vkcv/BufferManager.hpp @@ -29,6 +29,10 @@ namespace vkcv class Core; + /** + * @brief Class to manage the creation, destruction, allocation + * and filling of buffers. + */ class BufferManager { friend class Core; diff --git a/include/vkcv/CommandRecordingFunctionTypes.hpp b/include/vkcv/CommandRecordingFunctionTypes.hpp index 702e4a65..d8cda421 100644 --- a/include/vkcv/CommandRecordingFunctionTypes.hpp +++ b/include/vkcv/CommandRecordingFunctionTypes.hpp @@ -11,7 +11,14 @@ namespace vkcv { + /** + * @brief Function to be called for recording a command buffer. + */ typedef typename event_function<const vk::CommandBuffer&>::type RecordCommandFunction; + + /** + * @brief Function to be called after finishing a given process. + */ typedef typename event_function<>::type FinishCommandFunction; } \ No newline at end of file diff --git a/include/vkcv/CommandResources.hpp b/include/vkcv/CommandResources.hpp index 946e9c53..8ec868c0 100644 --- a/include/vkcv/CommandResources.hpp +++ b/include/vkcv/CommandResources.hpp @@ -12,6 +12,10 @@ namespace vkcv { + /** + * @brief Structure to store command pools for given queue families + * of a device. + */ struct CommandResources { std::vector<vk::CommandPool> cmdPoolPerQueueFamily; }; diff --git a/include/vkcv/ComputePipelineConfig.hpp b/include/vkcv/ComputePipelineConfig.hpp index e3157f7a..ab458aa5 100644 --- a/include/vkcv/ComputePipelineConfig.hpp +++ b/include/vkcv/ComputePipelineConfig.hpp @@ -12,6 +12,9 @@ namespace vkcv { + /** + * @brief Structure to configure a compute pipeline before its creation. + */ struct ComputePipelineConfig { ShaderProgram& m_ShaderProgram; std::vector<DescriptorSetLayoutHandle> m_DescriptorSetLayouts; diff --git a/include/vkcv/Context.hpp b/include/vkcv/Context.hpp index 7d4670c3..b756373d 100644 --- a/include/vkcv/Context.hpp +++ b/include/vkcv/Context.hpp @@ -14,6 +14,13 @@ namespace vkcv { + + /** + * @brief Class to manage the vulkan resources as an instance, + * a device, a physical device and a memory allocator. Additionally + * instances of this class will hold the feature manager and the + * queue manager. + */ class Context { friend class Core; @@ -119,4 +126,5 @@ namespace vkcv vma::Allocator m_Allocator; }; + } diff --git a/include/vkcv/Core.hpp b/include/vkcv/Core.hpp index 35c4756f..86c1586d 100644 --- a/include/vkcv/Core.hpp +++ b/include/vkcv/Core.hpp @@ -52,6 +52,10 @@ namespace vkcv std::vector<vk::Semaphore> signalSemaphores; }; + /** + * @brief The class handles the core functionality of the framework with + * most calls addressing resource management via more simplified abstraction. + */ class Core final { private: diff --git a/include/vkcv/DescriptorWrites.hpp b/include/vkcv/DescriptorWrites.hpp index bb7f2591..4bdbee4a 100644 --- a/include/vkcv/DescriptorWrites.hpp +++ b/include/vkcv/DescriptorWrites.hpp @@ -42,6 +42,10 @@ namespace vkcv { uint32_t binding; }; + /** + * @brief Class to store details about writing to + * a descriptor set and its bindings. + */ class DescriptorWrites { private: std::vector<SampledImageDescriptorWrite> m_sampledImageWrites; @@ -52,43 +56,136 @@ namespace vkcv { std::vector<AccelerationDescriptorWrite> m_accelerationWrites; public: + /** + * @brief Adds an entry to write an image to a given binding + * of a descriptor set to sample from it using specific details. + * + * @param[in] binding Binding index + * @param[in] image Image handle + * @param[in] mipLevel Mip level index + * @param[in] useGeneralLayout Flag to use a general layout + * @param[in] arrayIndex Image array index + * @return Instance of descriptor writes + */ DescriptorWrites& writeSampledImage(uint32_t binding, ImageHandle image, uint32_t mipLevel = 0, bool useGeneralLayout = false, uint32_t arrayIndex = 0); + /** + * @brief Adds an entry to write an image to a given binding + * of a descriptor set to store into it using specific details. + * + * @param[in] binding Binding index + * @param[in,out] image Image handle + * @param[in] mipLevel Mip level index + * @return Instance of descriptor writes + */ DescriptorWrites& writeStorageImage(uint32_t binding, ImageHandle image, uint32_t mipLevel = 0); + /** + * @brief Adds an entry to write a buffer to a given binding + * of a descriptor set as uniform buffer using specific details. + * + * @param[in] binding Binding index + * @param[in] buffer Buffer handle + * @param[in] dynamic Flag to use dynamic access + * @param[in] offset Offset for buffer access range + * @param[in] size Size of the buffer access range + * @return Instance of descriptor writes + */ DescriptorWrites& writeUniformBuffer(uint32_t binding, BufferHandle buffer, bool dynamic = false, uint32_t offset = 0, uint32_t size = 0); + /** + * @brief Adds an entry to write a buffer to a given binding + * of a descriptor set as storage buffer using specific details. + * + * @param[in] binding Binding index + * @param[in] buffer Buffer handle + * @param[in,out] dynamic Flag to use dynamic access + * @param[in] offset Offset for buffer access range + * @param[in] size Size of the buffer access range + * @return Instance of descriptor writes + */ DescriptorWrites& writeStorageBuffer(uint32_t binding, BufferHandle buffer, bool dynamic = false, uint32_t offset = 0, uint32_t size = 0); + /** + * @brief Adds an entry to write a sampler to a given binding + * of a descriptor set. + * + * @param[in] binding Binding index + * @param[in] sampler Sampler handle + * @return Instance of descriptor writes + */ DescriptorWrites& writeSampler(uint32_t binding, SamplerHandle sampler); + /** + * @brief Adds an entry for acceleration to a given binding + * of a descriptor set. + * + * @param[in] binding Binding index + * @return Instance of descriptor writes + */ DescriptorWrites& writeAcceleration(uint32_t binding); + /** + * @brief Returns the list of stored write entries for sampled images. + * + * @return Sampled image write details + */ + [[nodiscard]] const std::vector<SampledImageDescriptorWrite>& getSampledImageWrites() const; + /** + * @brief Returns the list of stored write entries for storage images. + * + * @return Storage image write details + */ + [[nodiscard]] const std::vector<StorageImageDescriptorWrite>& getStorageImageWrites() const; + /** + * @brief Returns the list of stored write entries for uniform buffers. + * + * @return Uniform buffers write details + */ + [[nodiscard]] const std::vector<BufferDescriptorWrite>& getUniformBufferWrites() const; + /** + * @brief Returns the list of stored write entries for storage buffers. + * + * @return Storage buffers write details + */ + [[nodiscard]] const std::vector<BufferDescriptorWrite>& getStorageBufferWrites() const; + /** + * @brief Returns the list of stored write entries for samplers. + * + * @return Samplers write details + */ + [[nodiscard]] const std::vector<SamplerDescriptorWrite>& getSamplerWrites() const; + /** + * @brief Returns the list of stored write entries for accelerations. + * + * @return Accelerations write details + */ + [[nodiscard]] const std::vector<AccelerationDescriptorWrite>& getAccelerationWrites() const; }; diff --git a/include/vkcv/GraphicsPipelineConfig.hpp b/include/vkcv/GraphicsPipelineConfig.hpp index d0a1fec4..b5ce9e0a 100644 --- a/include/vkcv/GraphicsPipelineConfig.hpp +++ b/include/vkcv/GraphicsPipelineConfig.hpp @@ -22,7 +22,10 @@ namespace vkcv { // add more as needed // alternatively we could expose the blend factors directly enum class BlendMode{ None, Additive }; - + + /** + * @brief Structure to configure a graphics pipeline before its creation. + */ struct GraphicsPipelineConfig { ShaderProgram m_ShaderProgram; uint32_t m_Width; -- GitLab