]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/programdata.h
Multiplex streaming buffer contents on Vulkan
[libs/gl.git] / source / render / programdata.h
index 9d08219ef84368943f6cb4535466bc61a1c742af..5d674a38a2504f8360d338f5ac74b85f3545689e 100644 (file)
@@ -2,6 +2,7 @@
 #define MSP_GL_PROGRAMDATA_H_
 
 #include <stdexcept>
+#include <msp/core/noncopyable.h>
 #include <msp/datafile/objectloader.h>
 #include "datatype.h"
 #include "matrix.h"
@@ -35,7 +36,7 @@ programs have the same layout, the same block is used for them.
 The class is optimized for an access pattern where the set of uniforms and
 programs stays constants, with only the values changing.
 */
-class ProgramData
+class ProgramData: public NonCopyable
 {
 public:
        class Loader: public DataFile::ObjectLoader<ProgramData>
@@ -162,9 +163,7 @@ private:
 
 public:
        ProgramData(const Program * = 0);
-       ProgramData(const ProgramData &);
-       ProgramData(const ProgramData &, const Program *);
-       ProgramData &operator=(const ProgramData &);
+       ProgramData(ProgramData &&);
        ~ProgramData();
 
 private:
@@ -173,19 +172,26 @@ private:
        void mark_dirty(Mask);
 public:
        void uniform(Tag, int);
+       void uniform(Tag, unsigned);
        void uniform(Tag, float);
        void uniform(Tag, int, int);
+       void uniform(Tag, unsigned, unsigned);
        void uniform(Tag, float, float);
        void uniform2(Tag, const int *);
+       void uniform2(Tag, const unsigned *);
        void uniform2(Tag, const float *);
        void uniform(Tag, int, int, int);
+       void uniform(Tag, unsigned, unsigned, unsigned);
        void uniform(Tag, float, float, float);
        void uniform3(Tag, const int *);
+       void uniform3(Tag, const unsigned *);
        void uniform3(Tag, const float *);
        void uniform(Tag, int, int, int, int);
+       void uniform(Tag, unsigned, unsigned, unsigned, unsigned);
        void uniform(Tag, float, float, float, float);
        void uniform(Tag, const Color &);
        void uniform4(Tag, const int *);
+       void uniform4(Tag, const unsigned *);
        void uniform4(Tag, const float *);
        void uniform_matrix2(Tag, const float *);
        void uniform_matrix3x2(Tag, const float *);
@@ -198,14 +204,19 @@ public:
        void uniform(Tag, const Matrix &);
        void uniform_matrix4(Tag, const float *);
        void uniform_array(Tag, unsigned, const int *);
+       void uniform_array(Tag, unsigned, const unsigned *);
        void uniform_array(Tag, unsigned, const float *);
        void uniform1_array(Tag, unsigned, const int *);
+       void uniform1_array(Tag, unsigned, const unsigned *);
        void uniform1_array(Tag, unsigned, const float *);
        void uniform2_array(Tag, unsigned, const int *);
+       void uniform2_array(Tag, unsigned, const unsigned *);
        void uniform2_array(Tag, unsigned, const float *);
        void uniform3_array(Tag, unsigned, const int *);
+       void uniform3_array(Tag, unsigned, const unsigned *);
        void uniform3_array(Tag, unsigned, const float *);
        void uniform4_array(Tag, unsigned, const int *);
+       void uniform4_array(Tag, unsigned, const unsigned *);
        void uniform4_array(Tag, unsigned, const float *);
        void uniform_matrix2_array(Tag, unsigned, const float *);
        void uniform_matrix3x2_array(Tag, unsigned, const float *);
@@ -235,6 +246,7 @@ public:
 
        std::vector<Tag> get_uniform_tags() const;
        void copy_uniform(const ProgramData &, Tag);
+       void copy_uniforms(const ProgramData &);
 
 private:
        int find_uniform_index(Tag) const;
@@ -246,7 +258,7 @@ private:
 public:
        /** Creates or updates UniformBlocks for a specific program if necessary,
        then sets them to the PipelineState. */
-       void apply(const Program &, PipelineState &) const;
+       void apply(const Program &, PipelineState &, unsigned) const;
 
        void set_debug_name(const std::string &);
 };