X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fpipelinestate.h;h=68983d11c1d7f3d00ef3d3656bf487c396c6f6ce;hb=6c1cb01d562bb8fbfe6559f00d42e811caebc8cd;hp=1d313c3b3eb1dea828bacce03d545a4e751748df;hpb=c4d81a13ca8ac1479eca78ee190f3762ef3cbec4;p=libs%2Fgl.git diff --git a/source/core/pipelinestate.h b/source/core/pipelinestate.h index 1d313c3b..68983d11 100644 --- a/source/core/pipelinestate.h +++ b/source/core/pipelinestate.h @@ -1,5 +1,5 @@ -#ifndef PIPELINESTATE_H_ -#define PIPELINESTATE_H_ +#ifndef MSP_GL_PIPELINESTATE_H_ +#define MSP_GL_PIPELINESTATE_H_ #include #include @@ -8,14 +8,16 @@ namespace Msp { namespace GL { -class BufferBackedUniformBlock; -class DefaultUniformBlock; +class Blend; +class DepthTest; +class Framebuffer; class Program; +class Rect; class Sampler; +class StencilTest; class Texture; class UniformBlock; class VertexSetup; -class WindingTest; class PipelineState: public NonCopyable { @@ -46,9 +48,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,10 +67,15 @@ 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; static std::vector bound_tex_targets; + static std::vector bound_uniform_blocks; + static unsigned restart_index; public: PipelineState(); @@ -69,18 +85,21 @@ 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); void set_face_cull(CullMode); void set_enabled_clip_planes(unsigned); void set_texture(unsigned, const Texture *, const Sampler *); - void set_uniforms(const DefaultUniformBlock *); - void set_uniform_block(unsigned, const BufferBackedUniformBlock *); -private: - void set_uniform_block_(int, const UniformBlock *); -public: + void set_uniform_block(int, const UniformBlock *); + void set_depth_test(const DepthTest *); + 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; }