improved docs

This commit is contained in:
Jorijn van der Graaf 2025-06-14 14:58:02 +02:00
commit dfe9b1abe9
16 changed files with 315 additions and 40 deletions

View file

@ -32,9 +32,25 @@ import :VulkanShader;
import :WindowWaylandVulkan;
namespace Crafter {
export template <typename MeshShader, typename FragmentShader> class DescriptorSet;
/**
* @brief A generic Vulkan graphics pipeline wrapper using template-based shaders.
*
* This class encapsulates the creation and management of a Vulkan graphics pipeline
* with a specified mesh shader and fragment shader. It provides static members for
* the pipeline, pipeline layout, and descriptor set layouts, which are shared across
* all instances of this template specialization.
*
* @tparam MeshShader The mesh shader type used in the pipeline.
* @tparam FragmentShader The fragment shader type used in the pipeline.
*
* @note Before using this pipeline, the CreatePipeline() function must be called,
* and all shader modules specified by the template parameters must be created.
*/
export template <typename MeshShader, typename FragmentShader>
class VulkanPipeline {
private:
friend class DescriptorSet<MeshShader, FragmentShader>;
template <typename Shader, VkShaderStageFlagBits Flag>
consteval static std::array<VkDescriptorSetLayoutBinding, Shader::descriptorCount> GetDescriptorSet() {
std::array<VkDescriptorSetLayoutBinding, Shader::descriptorCount> set;
@ -45,11 +61,10 @@ namespace Crafter {
return set;
}
inline static VkDescriptorSetLayout descriptorSetLayout[2];
public:
inline static VkPipeline pipeline;
inline static VkPipelineLayout pipelineLayout;
inline static VkDescriptorSetLayout descriptorSetLayout[2];
/**
* @brief Creates the vulkan pipeline, this must be called before any use of this pipeline and all shaders must be created before this pipeline is created.