backup - needs fixing
[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 struct Pipeline {
11
12 };
13
14 class ShaderVK : public Shader
15 {
16 protected:
17         SType type;
18         std::string name;
19
20         virtual bool create(char *buf, unsigned int bsz, const char *fname) override;
21
22 public:
23         ShaderVK();
24         virtual ~ShaderVK();
25
26         virtual bool load(const char *fname, SType type);
27         virtual void destroy() override;
28 };
29
30 class ShaderProgramVK : public ShaderProgram
31 {
32 protected:
33         Pipeline pipeline;
34         /*ubo*/
35
36 public:
37         ShaderProgramVK();
38         virtual ~ShaderProgramVK();
39
40         virtual bool create() override;
41         virtual bool use() const override;
42         virtual bool link() override;
43         virtual void destroy() override;
44         virtual void attach_shader(Shader *shader) override;
45
46         virtual int get_uniform_location(const char *name) const override;
47
48         virtual void set_uniformi(int location, int value) override;
49         virtual void set_uniformi(int location, int x, int y) override;
50         virtual void set_uniformi(int location, int x, int y, int z) override;
51         virtual void set_uniformi(int location, int x, int y, int z, int w) override;
52
53         virtual void set_uniformf(int location, float value) override;
54         virtual void set_uniformf(int location, float x, float y) override;
55         virtual void set_uniformf(int location, float x, float y, float z) override;
56         virtual void set_uniformf(int location, float x, float y, float z, float w) override;
57
58         virtual void set_uniform_matrix(int location, const Mat4 &mat) override;
59 };
60 #endif // SHADER_VK_H_