Changed the OpenGL part and the GLSL shaders to use UBO and
[demo] / src / vulkan / shader-vk.h
index 1914a4f..efc576f 100644 (file)
@@ -7,12 +7,7 @@
 /* each shader program will correspond to a pipeline. The pipeline
  * must have the cull, zbuffer etc since they can't be dynamic states */
 
-struct Pipeline {
-
-};
-
-class ShaderVK : public Shader
-{
+class ShaderVK : public Shader {
 protected:
        SType type;
        std::string name;
@@ -20,41 +15,31 @@ protected:
        virtual bool create(char *buf, unsigned int bsz, const char *fname) override;
 
 public:
+       VkShaderModule sm;
+
        ShaderVK();
        virtual ~ShaderVK();
 
-       virtual bool load(const char *fname, SType type);
+       virtual bool load(const char *fname, SType type) override;
        virtual void destroy() override;
 };
 
 class ShaderProgramVK : public ShaderProgram
 {
+private:
+       VkPipeline gpipeline;
+
 protected:
-       Pipeline pipeline;
-       /*ubo*/
 
 public:
        ShaderProgramVK();
        virtual ~ShaderProgramVK();
 
        virtual bool create() override;
+
        virtual bool use() const override;
        virtual bool link() override;
        virtual void destroy() override;
        virtual void attach_shader(Shader *shader) override;
-
-       virtual int get_uniform_location(const char *name) const override;
-
-       virtual void set_uniformi(int location, int value) override;
-       virtual void set_uniformi(int location, int x, int y) override;
-       virtual void set_uniformi(int location, int x, int y, int z) override;
-       virtual void set_uniformi(int location, int x, int y, int z, int w) override;
-
-       virtual void set_uniformf(int location, float value) override;
-       virtual void set_uniformf(int location, float x, float y) override;
-       virtual void set_uniformf(int location, float x, float y, float z) override;
-       virtual void set_uniformf(int location, float x, float y, float z, float w) override;
-
-       virtual void set_uniform_matrix(int location, const Mat4 &mat) override;
 };
 #endif // SHADER_VK_H_