From: Mikko Rasa Date: Fri, 26 Aug 2016 23:29:41 +0000 (+0300) Subject: Use RAII to restore the output FBO in Pipeline::render X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e1f9db7e8550d5c9629ac5ad0e2f8dc2dd4efa8d;p=libs%2Fgl.git Use RAII to restore the output FBO in Pipeline::render --- diff --git a/source/pipeline.cpp b/source/pipeline.cpp index a27058ef..e3da0530 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -176,7 +176,8 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const setup_frame(); const Framebuffer *out_fbo = Framebuffer::current(); - // XXX Make sure the correct FBO is restored if an exception is thrown + // This is a no-op but will ensure the FBO binding gets restored + BindRestore restore_fbo(out_fbo); if(target[0]) { @@ -216,8 +217,6 @@ void Pipeline::render(Renderer &renderer, const Tag &tag) const out_fbo->bind(); postproc[i]->render(target[j]->color, target[j]->depth); } - - out_fbo->bind(); } if(!was_in_frame)