| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

ShaderProgram.h
Go to the documentation of this file.
1 #pragma once
2 #include "FlingVulkan.h"
3 #include "GraphicsPipeline.h"
4 #include "Buffer.h"
5 #include "Texture.h"
6 #include "MultiSampler.h"
7
8 #include <vector>
9
10 #define DeferredStr "Deferred"
11 #define DeferredStr_CAP "DEFERRED"
12
13
14 namespace Fling
15 {
16 enum class ShaderProgramType
17 {
18 PBR = 0,
19 Reflection = 1,
20 Deferred = 2,
21 MAX_COUNT // Max count here so that we can iterate over the programs a bit easier in the editor later
22 };
23
24 class ShaderProgram
25 {
26 public:
27 ShaderProgram(VkDevice t_Device, const std::vector<Shader*>& t_Shaders);
28 ~ShaderProgram();
29
30 void InitGraphicPipeline(VkRenderPass t_Renderpass, Multisampler* t_Sampler);
31
32 const std::shared_ptr<GraphicsPipeline> GetPipeline() const { return m_Pipeline; };
33 VkDescriptorSetLayout& GetDescriptorLayout() { return m_DescriptorLayout; }
34 VkPipelineLayout& GetPipelineLayout() { return m_PipelineLayout; }
35
36 static ShaderProgramType ShaderProgramFromStr(std::string& t_Str);
37
38 private:
39 VkDescriptorSetLayout m_DescriptorLayout;
40 VkPipelineLayout m_PipelineLayout;
41 std::shared_ptr<GraphicsPipeline> m_Pipeline;
42 std::vector<Shader*> m_Shaders;
43 VkDevice m_Device;
44 };
45 } //namespace fling
Fling::ShaderProgram::GetPipelineLayout
VkPipelineLayout & GetPipelineLayout()
Definition: ShaderProgram.h:34
Fling::ShaderProgram::GetPipeline
const std::shared_ptr< GraphicsPipeline > GetPipeline() const
Definition: ShaderProgram.h:32
FlingVulkan.h
Fling::ShaderProgramType::PBR
Texture.h
Fling::ShaderProgramType::Deferred
Fling::ShaderProgram::m_Device
VkDevice m_Device
Definition: ShaderProgram.h:43
MultiSampler.h
Fling::Multisampler
A multi-sampler will allow us to enable MSAA.
Definition: MultiSampler.h:14
Fling::ShaderProgramType::MAX_COUNT
Fling::ShaderProgram::m_Pipeline
std::shared_ptr< GraphicsPipeline > m_Pipeline
Definition: ShaderProgram.h:41
GraphicsPipeline.h
Fling::ShaderProgram::GetDescriptorLayout
VkDescriptorSetLayout & GetDescriptorLayout()
Definition: ShaderProgram.h:33
Fling::ShaderProgram::m_PipelineLayout
VkPipelineLayout m_PipelineLayout
Definition: ShaderProgram.h:40
Fling::ShaderProgram::m_Shaders
std::vector< Shader * > m_Shaders
Definition: ShaderProgram.h:42
Fling::ShaderProgramType::Reflection
Buffer.h
Fling
Definition: Engine.h:29
Fling::ShaderProgram
Definition: ShaderProgram.h:24
Fling::ShaderProgramType
ShaderProgramType
Definition: ShaderProgram.h:16
Fling::ShaderProgram::m_DescriptorLayout
VkDescriptorSetLayout m_DescriptorLayout
Definition: ShaderProgram.h:39