X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fpipeline.cpp;fp=source%2Fpipeline.cpp;h=4c4007233d2b9fd82cc82f9bf7cccdf0cc56f3e4;hb=7791ca3eac17e355d1de508b1730dc854ed7712d;hp=a5d7436aaace7cd48074d6c6c02a9ecefda94948;hpb=a525c632144d3dcefe373916bdde789727d2230d;p=libs%2Fgl.git diff --git a/source/pipeline.cpp b/source/pipeline.cpp index a5d7436a..4c400723 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -21,8 +21,7 @@ Pipeline::Pipeline(unsigned w, unsigned h, bool d): height(h), hdr(d), samples(0), - target_ms(0), - in_frame(false) + target_ms(0) { target[0] = 0; target[1] = 0; @@ -139,7 +138,6 @@ void Pipeline::add_postprocessor(PostProcessor &pp) void Pipeline::setup_frame() const { - in_frame = true; for(PassList::const_iterator i=passes.begin(); i!=passes.end(); ++i) if(const Renderable *renderable = i->get_renderable()) renderable->setup_frame(); @@ -149,7 +147,6 @@ void Pipeline::setup_frame() const void Pipeline::finish_frame() const { - in_frame = false; for(PassList::const_iterator i=passes.begin(); i!=passes.end(); ++i) if(const Renderable *renderable = i->get_renderable()) renderable->finish_frame(); @@ -163,7 +160,9 @@ void Pipeline::render(const Tag &tag) const return; Renderer renderer(camera); + setup_frame(); render(renderer, tag); + finish_frame(); } void Pipeline::render(Renderer &renderer, const Tag &tag) const @@ -171,10 +170,6 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const if(tag.id) return; - bool was_in_frame = in_frame; - if(!in_frame) - setup_frame(); - const Framebuffer *out_fbo = Framebuffer::current(); // These is a no-ops but will ensure the related state gets restored BindRestore restore_fbo(out_fbo); @@ -232,9 +227,6 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const postproc[i]->render(renderer, color, depth); } } - - if(!was_in_frame) - finish_frame(); } void Pipeline::create_targets(unsigned recreate)