diff --git a/include/vkcv/Buffer.hpp b/include/vkcv/Buffer.hpp index 61d4a97ba1fcbb274b3011446ca186389ea52de2..a3784087c0b217656d8a5e3e660457093674cb02 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 6f197d12042e522a3bf16b604c73f3b7b6f46f04..c66e66ed7003842dd20ea756f2abfc7be1cdc0c8 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 702e4a65c21e58a0e7748a9b8d74faaeac965c7d..d8cda4216e6fbd5686240f52fa0838650ef409df 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 946e9c539b988fc305f90a5fa48c6c978fb590a8..8ec868c0a5a353cba2efb2313d4168450f30844b 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 e3157f7a4e688fb2b33397b713cdb93e1cacfcaf..ab458aa53704ccc1d5dbe2f1024d826b0b337f78 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 7d4670c338d7a941835e6375757dd45fe7ef397e..b756373dde0863795ee6aeaf5faefbcbdc02e159 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 35c4756f0a32fc7ea789abbf872125437b208810..86c1586da0b938646df45a7e7702b83a56aca7cc 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 bb7f2591e28b8e6f189ffe0b3c32107a1711f3fd..4bdbee4a3ae559e5f4b7f57a1daf6276e6c59e3c 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 d0a1fec45ee8dc65eea4aacb4550186e71948231..b5ce9e0a8357916a9fda29c60eb55a9ddb479710 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;