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 
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
VkPipelineLayout & GetPipelineLayout()
Definition: ShaderProgram.h:34
const std::shared_ptr< GraphicsPipeline > GetPipeline() const
Definition: ShaderProgram.h:32
VkDevice m_Device
Definition: ShaderProgram.h:43
A multi-sampler will allow us to enable MSAA.
Definition: MultiSampler.h:14
std::shared_ptr< GraphicsPipeline > m_Pipeline
Definition: ShaderProgram.h:41
VkDescriptorSetLayout & GetDescriptorLayout()
Definition: ShaderProgram.h:33
VkPipelineLayout m_PipelineLayout
Definition: ShaderProgram.h:40
std::vector< Shader * > m_Shaders
Definition: ShaderProgram.h:42
Definition: Engine.h:29
Definition: ShaderProgram.h:24
ShaderProgramType
Definition: ShaderProgram.h:16
VkDescriptorSetLayout m_DescriptorLayout
Definition: ShaderProgram.h:39