]> git.sesse.net Git - movit/commitdiff
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 00151977be63823288cd0d1c9497e7b9d2708fdb..574c44e2a68a0c7dac6e5ff43693a628c7ae61af 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();
                        // 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));
                        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();
                                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);
                }
 
                        glViewport(0, 0, phases[phase]->output_width, phases[phase]->output_height);
                }