diff --git a/include/vkcv/Image.hpp b/include/vkcv/Image.hpp index 8752a9b38aaf70a889c62a7386307d1dbe1f5dad..06090750579525ce07b5db95992129a07f2c5337 100644 --- a/include/vkcv/Image.hpp +++ b/include/vkcv/Image.hpp @@ -14,6 +14,13 @@ namespace vkcv { class ImageManager; + /** + * @brief Returns whether an image format is usable as depth buffer. + * + * @param format Vulkan image format + * @return True, if the format is valid to use as depth buffer, + * otherwise false. + */ bool isDepthFormat(const vk::Format format); class Image { @@ -21,76 +28,107 @@ namespace vkcv { public: /** - * @return Vulkan format of the image + * @brief Returns the format of the image. + * + * @return Vulkan image format */ [[nodiscard]] vk::Format getFormat() const; /** + * @brief Returns the width of the image. + * * @return Width of the image */ [[nodiscard]] uint32_t getWidth() const; /** + * @brief Returns the height of the image. + * * @return Height of the image */ [[nodiscard]] uint32_t getHeight() const; /** + * @brief Returns the depth of the image. + * * @return Depth of the image */ [[nodiscard]] uint32_t getDepth() const; /** - * @return Handle of the image to be used with the #Core + * @brief Returns the image handle of the image. + * + * @return Handle of the image */ [[nodiscard]] const vkcv::ImageHandle& getHandle() const; /** - * @return Number of mip levels of the image + * @brief Returns the amount of mip levels of the image. + * + * @return Number of mip levels */ [[nodiscard]] uint32_t getMipCount() const; /** - * @brief Switch the image layout, returns after operation is finished + * @brief Switches the image layout, + * returns after operation is finished. * - * @param newLayout Layout that image is switched to + * @param[in] newLayout Layout that image is switched to */ void switchLayout(vk::ImageLayout newLayout); /** - * @brief Fill the image with data + * @brief Fills the image with data of a given size in bytes. * - * @param data Pointer to the source data - * @param size Lower limit of the data size to copy in bytes, + * @param[in] data Pointer to the source data + * @param[in] size Lower limit of the data size to copy in bytes, * the actual number of copied bytes is min(size, imageDataSize) */ void fill(const void* data, size_t size = SIZE_MAX); /** - * @brief Generates the entire mip chain from mip 0, returns after operation is finished + * @brief Generates the entire mip chain from mip level zero, + * returns after operation is finished */ void generateMipChainImmediate(); /** - * @brief Record mip chain generation to command stream, mip 0 is used as source + * @brief Records mip chain generation to command stream, + * mip level zero is used as source * - * @param cmdStream Command stream that the commands are recorded into + * @param[out] cmdStream Command stream that the commands are recorded into */ void recordMipChainGeneration(const vkcv::CommandStreamHandle& cmdStream); + private: // TODO: const qualifier removed, very hacky!!! // Else you cannot recreate an image. Pls fix. - ImageManager* m_manager; - ImageHandle m_handle; + ImageManager* m_manager; + ImageHandle m_handle; Image(ImageManager* manager, const ImageHandle& handle); + /** + * @brief Creates an image with given parameters like width, height, + * depth, amount of mip levels and others. + * + * @param[in,out] manager Image manager + * @param[in] format Vulkan image format + * @param[in] width Width of the image + * @param[in] height Height of the image + * @param[in] depth Depth of the image + * @param[in] mipCount Amount of mip levels + * @param[in] supportStorage Support of storage + * @param[in] supportColorAttachment Support of color attachment + * @param[in] msaa MSAA mode + * @return New created image + */ static Image create( ImageManager* manager, vk::Format format, diff --git a/include/vkcv/ImageConfig.hpp b/include/vkcv/ImageConfig.hpp index 7f267c3e947bdd9758ac9e60e5c16741fbfa831a..d031f790622f1f0595c540c5bbcf0d8795f5fd95 100644 --- a/include/vkcv/ImageConfig.hpp +++ b/include/vkcv/ImageConfig.hpp @@ -11,7 +11,22 @@ namespace vkcv { enum class Multisampling { None, MSAA2X, MSAA4X, MSAA8X }; + /** + * @brief Returns the sample count flag bits of a given + * multi-sample anti-aliasing mode. + * + * @param[in] msaa MSAA mode + * @return Sample count flag bits + */ vk::SampleCountFlagBits msaaToVkSampleCountFlag(Multisampling msaa); - uint32_t msaaToSampleCount(Multisampling msaa); + + /** + * @brief Returns the amount of samples of a given + * multi-sample anti-aliasing mode. + * + * @param msaa MSAA mode + * @return Number of samples + */ + uint32_t msaaToSampleCount(Multisampling msaa); }