From fc2a5e2cde821494ac2b9ac5fa716d128c64f9a0 Mon Sep 17 00:00:00 2001 From: Tobias Frisch <tfrisch@uni-koblenz.de> Date: Thu, 26 May 2022 19:50:37 +0200 Subject: [PATCH] Added more doxygen comments to enums, some structs and more Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de> --- Doxyfile | 10 +++++++--- include/vkcv/DescriptorConfig.hpp | 3 +++ include/vkcv/DescriptorWrites.hpp | 22 +++++++++++++++++++--- include/vkcv/DrawcallRecording.hpp | 6 +++++- include/vkcv/Handles.hpp | 5 ++++- include/vkcv/ShaderStage.hpp | 3 +++ include/vkcv/SyncResources.hpp | 10 +++++++--- include/vkcv/VertexLayout.hpp | 10 ++++++++++ src/vkcv/Core.cpp | 12 ++++++++---- src/vkcv/VertexLayout.cpp | 1 + 10 files changed, 67 insertions(+), 15 deletions(-) diff --git a/Doxyfile b/Doxyfile index 72805085..05d73d3c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2159,6 +2159,10 @@ DOCBOOK_OUTPUT = docbook GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2345,7 +2349,7 @@ HIDE_UNDOC_RELATIONS = YES # set to NO # The default value is: NO. -HAVE_DOT = YES +HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed # to run in parallel. When set to 0 doxygen will base this on the number of @@ -2487,7 +2491,7 @@ INCLUDED_BY_GRAPH = YES # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALL_GRAPH = YES +CALL_GRAPH = NO # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller # dependency graph for every global function or class method. @@ -2499,7 +2503,7 @@ CALL_GRAPH = YES # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALLER_GRAPH = YES +CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # hierarchy of all classes instead of a textual one. diff --git a/include/vkcv/DescriptorConfig.hpp b/include/vkcv/DescriptorConfig.hpp index 038489d1..1d116e69 100644 --- a/include/vkcv/DescriptorConfig.hpp +++ b/include/vkcv/DescriptorConfig.hpp @@ -14,6 +14,9 @@ namespace vkcv { + /** + * @brief Enum class to specify the type of a descriptor set binding. + */ enum class DescriptorType { UNIFORM_BUFFER, STORAGE_BUFFER, diff --git a/include/vkcv/DescriptorWrites.hpp b/include/vkcv/DescriptorWrites.hpp index 4bdbee4a..b8468bfd 100644 --- a/include/vkcv/DescriptorWrites.hpp +++ b/include/vkcv/DescriptorWrites.hpp @@ -11,6 +11,9 @@ namespace vkcv { + /** + * @brief Structure to store details writing a sampled image to a descriptor set. + */ struct SampledImageDescriptorWrite { uint32_t binding; ImageHandle image; @@ -18,13 +21,19 @@ namespace vkcv { bool useGeneralLayout; uint32_t arrayIndex; }; - + + /** + * @brief Structure to store details writing a storage image to a descriptor set. + */ struct StorageImageDescriptorWrite { uint32_t binding; ImageHandle image; uint32_t mipLevel; }; - + + /** + * @brief Structure to store details writing a buffer to a descriptor set. + */ struct BufferDescriptorWrite { uint32_t binding; BufferHandle buffer; @@ -32,12 +41,19 @@ namespace vkcv { uint32_t offset; uint32_t size; }; - + + /** + * @brief Structure to store details writing a sampler to a descriptor set. + */ struct SamplerDescriptorWrite { uint32_t binding; SamplerHandle sampler; }; + /** + * @brief Structure to store details writing an acceleration structure to + * a descriptor set. + */ struct AccelerationDescriptorWrite { uint32_t binding; }; diff --git a/include/vkcv/DrawcallRecording.hpp b/include/vkcv/DrawcallRecording.hpp index 244508b4..8cdaaa9b 100644 --- a/include/vkcv/DrawcallRecording.hpp +++ b/include/vkcv/DrawcallRecording.hpp @@ -23,7 +23,11 @@ namespace vkcv { vk::Buffer buffer; }; - enum class IndexBitCount{ + /** + * @brief Enum class to specify the size of indexes. + */ + enum class IndexBitCount { + Bit8, Bit16, Bit32 }; diff --git a/include/vkcv/Handles.hpp b/include/vkcv/Handles.hpp index bfe2ac26..dea17938 100644 --- a/include/vkcv/Handles.hpp +++ b/include/vkcv/Handles.hpp @@ -12,10 +12,13 @@ namespace vkcv { + /** + * @brief Function to be called when a handles resources can be destroyed. + */ typedef typename event_function<uint64_t>::type HandleDestroyFunction; /** - * Class for general memory management via handles. + * @brief Class for general memory management via handles. */ class Handle { friend std::ostream& operator << (std::ostream& out, const Handle& handle); diff --git a/include/vkcv/ShaderStage.hpp b/include/vkcv/ShaderStage.hpp index b964c63f..39b250e8 100644 --- a/include/vkcv/ShaderStage.hpp +++ b/include/vkcv/ShaderStage.hpp @@ -9,6 +9,9 @@ namespace vkcv { + /** + * @brief Enum class to specify the stage of a shader. + */ enum class ShaderStage : VkShaderStageFlags { VERTEX = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eVertex), TESS_CONTROL = static_cast<VkShaderStageFlags>(vk::ShaderStageFlagBits::eTessellationControl), diff --git a/include/vkcv/SyncResources.hpp b/include/vkcv/SyncResources.hpp index 9a2de30f..1683855b 100644 --- a/include/vkcv/SyncResources.hpp +++ b/include/vkcv/SyncResources.hpp @@ -9,10 +9,14 @@ namespace vkcv { + /** + * @brief Structure to store vulkan resources for presenting + * with a pipeline. + */ struct SyncResources { - vk::Semaphore renderFinished; - vk::Semaphore swapchainImageAcquired; - vk::Fence presentFinished; + vk::Semaphore renderFinished; + vk::Semaphore swapchainImageAcquired; + vk::Fence presentFinished; }; /** diff --git a/include/vkcv/VertexLayout.hpp b/include/vkcv/VertexLayout.hpp index 588e898e..b375aaf6 100644 --- a/include/vkcv/VertexLayout.hpp +++ b/include/vkcv/VertexLayout.hpp @@ -12,6 +12,9 @@ namespace vkcv { + /** + * @brief Enum class to specify the format of vertex attributes. + */ enum class VertexAttachmentFormat{ FLOAT, FLOAT2, @@ -23,6 +26,13 @@ namespace vkcv { INT4 }; + /** + * @brief Returns the size in bytes of a vertex with a + * given vertex format. + * + * @param[in] format Vertex format + * @return Size in bytes + */ uint32_t getFormatSize(VertexAttachmentFormat format); struct VertexAttachment{ diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index 42e96b51..417157ab 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -271,11 +271,15 @@ namespace vkcv vk::IndexType getIndexType(IndexBitCount indexByteCount){ switch (indexByteCount) { - case IndexBitCount::Bit16: return vk::IndexType::eUint16; - case IndexBitCount::Bit32: return vk::IndexType::eUint32; - default: - vkcv_log(LogLevel::ERROR, "unknown Enum"); + case IndexBitCount::Bit8: + return vk::IndexType::eUint8EXT; + case IndexBitCount::Bit16: return vk::IndexType::eUint16; + case IndexBitCount::Bit32: + return vk::IndexType::eUint32; + default: + vkcv_log(LogLevel::ERROR, "unknown Enum"); + return vk::IndexType::eNoneKHR; } } diff --git a/src/vkcv/VertexLayout.cpp b/src/vkcv/VertexLayout.cpp index 0edced57..5298dd41 100644 --- a/src/vkcv/VertexLayout.cpp +++ b/src/vkcv/VertexLayout.cpp @@ -6,6 +6,7 @@ #include "vkcv/Logger.hpp" namespace vkcv { + uint32_t getFormatSize(VertexAttachmentFormat format) { switch (format) { case VertexAttachmentFormat::FLOAT: -- GitLab