]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/pipelinestate.h
Use standard fixed-size integer types
[libs/gl.git] / source / core / pipelinestate.h
index a931e25c406808232cd07809c44d616d15c5a7d4..b9fac143c7b9784773970b5710de7f9bdb9e80d8 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef PIPELINESTATE_H_
-#define PIPELINESTATE_H_
+#ifndef MSP_GL_PIPELINESTATE_H_
+#define MSP_GL_PIPELINESTATE_H_
 
 #include <vector>
 #include <msp/core/noncopyable.h>
@@ -12,13 +12,14 @@ class Blend;
 class BufferBackedUniformBlock;
 class DefaultUniformBlock;
 class DepthTest;
+class Framebuffer;
 class Program;
+class Rect;
 class Sampler;
 class StencilTest;
 class Texture;
 class UniformBlock;
 class VertexSetup;
-class WindingTest;
 
 class PipelineState: public NonCopyable
 {
@@ -52,9 +53,15 @@ private:
                UNIFORMS = 32,
                DEPTH_TEST = 64,
                STENCIL_TEST = 128,
-               BLEND = 256
+               BLEND = 256,
+               FRAMEBUFFER = 512,
+               VIEWPORT = 1024,
+               SCISSOR = 2048
        };
 
+       const Framebuffer *framebuffer;
+       const Rect *viewport;
+       const Rect *scissor;
        const Program *shprog;
        const VertexSetup *vertex_setup;
        FaceWinding front_face;
@@ -69,6 +76,8 @@ private:
 
        static const PipelineState *last_applied;
        static std::vector<int> bound_tex_targets;
+       static std::vector<char> bound_uniform_blocks;
+       static unsigned restart_index;
 
 public:
        PipelineState();
@@ -78,6 +87,9 @@ private:
        template<typename T>
        void set(T &, T, unsigned);
 public:
+       void set_framebuffer(const Framebuffer *);
+       void set_viewport(const Rect *);
+       void set_scissor(const Rect *);
        void set_shader_program(const Program *);
        void set_vertex_setup(const VertexSetup *);
        void set_front_face(FaceWinding);
@@ -93,6 +105,7 @@ public:
        void set_stencil_test(const StencilTest *);
        void set_blend(const Blend *);
 
+       const Framebuffer *get_framebuffer() const { return framebuffer; }
        const Program *get_shader_program() const { return shprog; }
        const VertexSetup *get_vertex_setup() const { return vertex_setup; }
        FaceWinding get_front_face() const { return front_face; }