1 #ifndef MSP_GL_PIPELINESTATE_H_
2 #define MSP_GL_PIPELINESTATE_H_
5 #include <msp/core/noncopyable.h>
7 #include "pipelinestate_backend.h"
23 class PipelineState: public PipelineStateBackend
25 friend PipelineStateBackend;
32 const Texture *texture;
33 const Sampler *sampler;
35 BoundTexture(unsigned);
38 struct BoundUniformBlock
42 const UniformBlock *block;
44 BoundUniformBlock(int);
63 const Framebuffer *framebuffer;
66 const Program *shprog;
67 const VertexSetup *vertex_setup;
68 FaceWinding front_face;
70 unsigned enabled_clip_planes;
71 std::vector<BoundTexture> textures;
72 std::vector<BoundUniformBlock> uniform_blocks;
73 const DepthTest *depth_test;
74 const StencilTest *stencil_test;
76 mutable unsigned changes;
83 void set(T &, T, unsigned);
85 void set_framebuffer(const Framebuffer *);
86 void set_viewport(const Rect *);
87 void set_scissor(const Rect *);
88 void set_shader_program(const Program *);
89 void set_vertex_setup(const VertexSetup *);
90 void set_front_face(FaceWinding);
91 void set_face_cull(CullMode);
92 void set_enabled_clip_planes(unsigned);
93 void set_texture(unsigned, const Texture *, const Sampler *);
94 void set_uniform_block(int, const UniformBlock *);
95 void set_depth_test(const DepthTest *);
96 void set_stencil_test(const StencilTest *);
97 void set_blend(const Blend *);
99 const Framebuffer *get_framebuffer() const { return framebuffer; }
100 const Program *get_shader_program() const { return shprog; }
101 const VertexSetup *get_vertex_setup() const { return vertex_setup; }
102 FaceWinding get_front_face() const { return front_face; }
103 CullMode get_face_cull() const { return face_cull; }