X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fsequence.cpp;h=4f10026ad497386b39ebb3a89fbd43e5e974518d;hb=5593d59bfe30fd7eecc55bc3580d87fcb91f0248;hp=6c98b4023c293db017d8b43dcc3c9619dbeeacc4;hpb=08e74e913d80693c79c00c18da1130cc5604952c;p=libs%2Fgl.git diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index 6c98b402..4f10026a 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -12,7 +12,7 @@ using namespace std; namespace Msp { namespace GL { -Tag Sequence::noclear_tag = "noclear"; +const Tag Sequence::noclear_tag = "noclear"; Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f): width(w), @@ -65,7 +65,7 @@ void Sequence::set_clear_stencil(int s) Sequence::Step &Sequence::add_step(Tag tag, Renderable &r) { - steps.push_back(Step(tag, &r)); + steps.emplace_back(tag, &r); return steps.back(); } @@ -143,8 +143,12 @@ void Sequence::render(Renderer &renderer, Tag tag) const if(target[0]) { + RenderTarget *source = target[0]; if(target_ms) - renderer.resolve_multisample(target[0]->get_framebuffer()); + { + renderer.resolve_multisample(); + source = target_ms; + } renderer.set_depth_test(0); renderer.set_stencil_test(0); @@ -152,11 +156,12 @@ void Sequence::render(Renderer &renderer, Tag tag) const for(unsigned i=0; iget_framebuffer() : out_fbo); - const Texture2D &color = target[j]->get_target_texture(COLOR_ATTACHMENT); - const Texture2D &depth = target[j]->get_target_texture(DEPTH_ATTACHMENT); + unsigned j = 1-i%2; + renderer.set_framebuffer(i+1get_framebuffer() : out_fbo); + const Texture2D &color = source->get_target_texture(COLOR_ATTACHMENT); + const Texture2D &depth = source->get_target_texture(DEPTH_ATTACHMENT); postproc[i]->render(renderer, color, depth); + source = target[j]; } } }