Changed the OpenGL part and the GLSL shaders to use UBO and
[demo] / src / vulkan / shader-vk.h
1 #ifndef SHADER_VK_H_
2 #define SHADER_VK_H_
3
4 #include <string>
5 #include "shader.h"
6
7 /* each shader program will correspond to a pipeline. The pipeline
8  * must have the cull, zbuffer etc since they can't be dynamic states */
9
10 class ShaderVK : public Shader {
11 protected:
12         SType type;
13         std::string name;
14
15         virtual bool create(char *buf, unsigned int bsz, const char *fname) override;
16
17 public:
18         VkShaderModule sm;
19
20         ShaderVK();
21         virtual ~ShaderVK();
22
23         virtual bool load(const char *fname, SType type) override;
24         virtual void destroy() override;
25 };
26
27 class ShaderProgramVK : public ShaderProgram
28 {
29 private:
30         VkPipeline gpipeline;
31
32 protected:
33
34 public:
35         ShaderProgramVK();
36         virtual ~ShaderProgramVK();
37
38         virtual bool create() override;
39
40         virtual bool use() const override;
41         virtual bool link() override;
42         virtual void destroy() override;
43         virtual void attach_shader(Shader *shader) override;
44 };
45 #endif // SHADER_VK_H_