Properly check framebuffer status when generating FBOs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Dec 2013 22:47:02 +0000 (23:47 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Dec 2013 22:47:02 +0000 (23:47 +0100)
effect_chain.cpp

index 0015197..574c44e 100644 (file)
@@ -1559,6 +1559,8 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height
                        // Last phase goes to the output the user specified.
                        glBindFramebuffer(GL_FRAMEBUFFER, dest_fbo);
                        check_error();
+                       GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+                       assert(status == GL_FRAMEBUFFER_COMPLETE);
                        glViewport(x, y, width, height);
                        if (dither_effect != NULL) {
                                CHECK(dither_effect->set_int("output_width", width));
@@ -1573,6 +1575,8 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height
                                output_node->output_texture,
                                0);
                        check_error();
+                       GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+                       assert(status == GL_FRAMEBUFFER_COMPLETE);
                        glViewport(0, 0, phases[phase]->output_width, phases[phase]->output_height);
                }