VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
ShaderPipeline.h
Go to the documentation of this file.
1
8#pragma once
9
11
18
20
21namespace venom
22{
23namespace vulkan
24{
25enum class PipelineType : uint32_t
26{
27 Graphics = 0,
28 Compute = 1,
29 RayTracing = 2
30};
31
33{
34public:
36 ~VulkanShaderResource() override;
37
38 void DestroyShaderModules();
39public:
40 VkPipeline pipeline;
41 VkPipelineLayout pipelineLayout;
42
43 std::vector<VkVertexInputBindingDescription> bindingDescriptions;
44 std::vector<VkVertexInputAttributeDescription> attributeDescriptions;
45
46 VkPipelineMultisampleStateCreateInfo multisamplingCreateInfo;
47 VkPipelineRasterizationStateCreateInfo rasterizerCreateInfo;
48 VkPipelineDepthStencilStateCreateInfo depthStencilCreateInfo;
49
50 std::vector<VkPipelineShaderStageCreateInfo> shaderStages;
51
52 bool shaderDirty;
53 PipelineType pipelineType;
54};
55
57{
58public:
60 ~VulkanShaderPipeline() override;
62 VulkanShaderPipeline& operator=(const VulkanShaderPipeline&) = delete;
64 VulkanShaderPipeline& operator=(VulkanShaderPipeline&& other) noexcept;
65
66 vc::Error _LoadShader(const std::string & path) override;
67 void SetMultiSamplingCount(const int samples) override;
68 void _SetLineWidth(const float width) override;
69 void _SetDepthTest(const bool enable) override;
70 void _SetDepthWrite(const bool enable) override;
71 vc::Error _ReloadShader() override;
72
73 void _AddVertexBufferToLayout(const uint32_t vertexSize, const uint32_t binding, const uint32_t location, const uint32_t offset, const vc::ShaderVertexFormat format) override;
74 vc::Error LoadShaders();
75 VkPipeline GetPipeline() const;
76 VkPipelineLayout GetPipelineLayout() const;
77 const VkDescriptorSetLayout & GetDescriptorSetLayout() const;
78private:
79 vc::Error LoadShader(const std::string& shaderPath, VkPipelineShaderStageCreateInfo * pipelineCreateInfo);
80};
81
82}
83}
Base class for cached resource holders.
Definition GraphicsPluginObject.h:57
Definition ShaderPipeline.h:45
Definition ShaderPipeline.h:18
Definition ShaderPipeline.h:57
Definition ShaderPipeline.h:33
Contains the entirety of the code of the VenomEngine project.
Definition Config.h:13