]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/pipelinestate.h
Redesign depth and stencil test and blend state management
[libs/gl.git] / source / core / pipelinestate.h
index 1d313c3b3eb1dea828bacce03d545a4e751748df..a931e25c406808232cd07809c44d616d15c5a7d4 100644 (file)
@@ -8,10 +8,13 @@
 namespace Msp {
 namespace GL {
 
+class Blend;
 class BufferBackedUniformBlock;
 class DefaultUniformBlock;
+class DepthTest;
 class Program;
 class Sampler;
+class StencilTest;
 class Texture;
 class UniformBlock;
 class VertexSetup;
@@ -46,7 +49,10 @@ private:
                FACE_CULL = 4,
                CLIP_PLANES = 8,
                TEXTURES = 16,
-               UNIFORMS = 32
+               UNIFORMS = 32,
+               DEPTH_TEST = 64,
+               STENCIL_TEST = 128,
+               BLEND = 256
        };
 
        const Program *shprog;
@@ -56,6 +62,9 @@ private:
        unsigned enabled_clip_planes;
        std::vector<BoundTexture> textures;
        std::vector<BoundUniformBlock> uniform_blocks;
+       const DepthTest *depth_test;
+       const StencilTest *stencil_test;
+       const Blend *blend;
        mutable unsigned changes;
 
        static const PipelineState *last_applied;
@@ -80,6 +89,9 @@ public:
 private:
        void set_uniform_block_(int, const UniformBlock *);
 public:
+       void set_depth_test(const DepthTest *);
+       void set_stencil_test(const StencilTest *);
+       void set_blend(const Blend *);
 
        const Program *get_shader_program() const { return shprog; }
        const VertexSetup *get_vertex_setup() const { return vertex_setup; }