X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fpipelinestate.h;h=9f6795f16ec176d0cb4204354dcd7b4b7a4ad53e;hb=ce3658993ce2f6b7527a04a36a5e1af349c6f2e9;hp=55d96485acbbbac28215369886476857ded52395;hpb=fe9836f2d8d7abb0480582c544611a5b248310cc;p=libs%2Fgl.git diff --git a/source/core/pipelinestate.h b/source/core/pipelinestate.h index 55d96485..9f6795f1 100644 --- a/source/core/pipelinestate.h +++ b/source/core/pipelinestate.h @@ -8,10 +8,15 @@ namespace Msp { namespace GL { +class Blend; class BufferBackedUniformBlock; class DefaultUniformBlock; +class DepthTest; +class Framebuffer; class Program; +class Rect; class Sampler; +class StencilTest; class Texture; class UniformBlock; class VertexSetup; @@ -46,9 +51,18 @@ private: FACE_CULL = 4, CLIP_PLANES = 8, TEXTURES = 16, - UNIFORMS = 32 + UNIFORMS = 32, + DEPTH_TEST = 64, + STENCIL_TEST = 128, + 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; @@ -56,6 +70,9 @@ private: unsigned enabled_clip_planes; std::vector textures; std::vector uniform_blocks; + const DepthTest *depth_test; + const StencilTest *stencil_test; + const Blend *blend; mutable unsigned changes; static const PipelineState *last_applied; @@ -65,6 +82,13 @@ public: PipelineState(); ~PipelineState(); +private: + template + 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); @@ -76,6 +100,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; }