X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fpipelinestate.h;h=0d0520a0262565a1c56a9b78ab9bece536677e95;hp=9573f9fede7eecc28a61bd7651728bb828c740cf;hb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;hpb=8366f8951984aa436938b1bb18a57067ff2260c1 diff --git a/source/core/pipelinestate.h b/source/core/pipelinestate.h index 9573f9fe..0d0520a0 100644 --- a/source/core/pipelinestate.h +++ b/source/core/pipelinestate.h @@ -4,13 +4,12 @@ #include #include #include "cullface.h" +#include "pipelinestate_backend.h" namespace Msp { namespace GL { class Blend; -class BufferBackedUniformBlock; -class DefaultUniformBlock; class DepthTest; class Framebuffer; class Program; @@ -21,8 +20,10 @@ class Texture; class UniformBlock; class VertexSetup; -class PipelineState: public NonCopyable +class PipelineState: public PipelineStateBackend { + friend PipelineStateBackend; + private: struct BoundTexture { @@ -59,31 +60,21 @@ private: SCISSOR = 2048 }; - const Framebuffer *framebuffer; - const Rect *viewport; - const Rect *scissor; - const Program *shprog; - const VertexSetup *vertex_setup; - FaceWinding front_face; - CullMode face_cull; - unsigned enabled_clip_planes; + const Framebuffer *framebuffer = 0; + const Rect *viewport = 0; + const Rect *scissor = 0; + const Program *shprog = 0; + const VertexSetup *vertex_setup = 0; + FaceWinding front_face = COUNTERCLOCKWISE; + CullMode face_cull = NO_CULL; + unsigned enabled_clip_planes = 0; 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(); - ~PipelineState(); + const DepthTest *depth_test = 0; + const StencilTest *stencil_test = 0; + const Blend *blend = 0; + mutable unsigned changes = 0; -private: template void set(T &, T, unsigned); public: @@ -106,12 +97,6 @@ public: const VertexSetup *get_vertex_setup() const { return vertex_setup; } FaceWinding get_front_face() const { return front_face; } CullMode get_face_cull() const { return face_cull; } - - void apply() const; -private: - void apply(unsigned) const; -public: - static void clear(); }; } // namespace GL