GNOME Bugzilla – Bug 690451
cogl calls glBlitFramebuffer with a 0x0 scissor enabled
Last modified: 2013-01-07 17:45:29 UTC
Created attachment 231832 [details] [review] Fix The NVIDIA driver currently has a bug that causes glBlitFramebuffer calls to ignore the scissor test. We're trying to fix that bug, but that's triggering a problem in gnome-shell: cogl_onscreen_swap_region calls cogl_flush, which flushes rendering that uses the scissor test, eventually resulting in a 0x0 scissor with GL_SCISSOR enabled. _cogl_winsys_onscreen_swap_region then fails to disable the scissor test again before calling glBlitFramebuffer, so no rendering occurs. The attached patch fixes the problem on fixed drivers by flushing the clip state before calling glBlitFramebuffer.
Thanks for the patch. I think just calling _cogl_framebuffer_flush_state might not be enough because that just flushes whatever is the current state that the application set up. The application could legitimately set a clip before calling cogl_onscreen_swap_region so we need to explicitly get rid of it. I'm attaching another patch.
Created attachment 231882 [details] [review] Clear the scissor before calling glBlitFramebuffer in swap_region glBlitFramebuffer is affected by the scissor so we need to ensure there is an empty clip flushed before using it. This is similar to what is done in _cogl_blit_framebuffer().
Aha, it wasn't clear to me whether something like that was necessary. Your patch works for me, so Tested-by: Aaron Plattner <aplattner@nvidia.com> Thanks, Neil!
Is there anything else I need to do to get this patch applied? I'd like to start pointing Linux distributions at it to avoid having to carry a workaround in the driver for too long.
Review of attachment 231832 [details] [review]: Superseded
This patch looks good to land to me. Sorry I didn't pick this up the other day when doing the 1.12.2 point release, but we should certainly land this on the cogl-1.12 branch and then hopefully we can do another point release soon too for distro's to pick up.
Ok, I've pushed it to master and the Cogl 1.12 branch. Thanks. http://git.gnome.org/browse/cogl/commit/?id=65da3f88af9 http://git.gnome.org/browse/cogl/commit/?h=cogl-1.12&id=f1baa4d60f1
Verified with commit f1baa4d60f1b48ee431c4aa78735baba8ec1d50b on the cogl-1.12 branch. Thanks!