After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 690451 - cogl calls glBlitFramebuffer with a 0x0 scissor enabled
cogl calls glBlitFramebuffer with a 0x0 scissor enabled
Status: VERIFIED FIXED
Product: cogl
Classification: Platform
Component: GLX
1.10.x
Other Linux
: Normal major
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-12-18 20:58 UTC by Aaron Plattner
Modified: 2013-01-07 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (1.17 KB, patch)
2012-12-18 20:58 UTC, Aaron Plattner
rejected Details | Review
Clear the scissor before calling glBlitFramebuffer in swap_region (1.46 KB, patch)
2012-12-19 14:28 UTC, Neil Roberts
none Details | Review

Description Aaron Plattner 2012-12-18 20:58:49 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.
Comment 1 Neil Roberts 2012-12-19 14:27:38 UTC
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.
Comment 2 Neil Roberts 2012-12-19 14:28:17 UTC
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().
Comment 3 Aaron Plattner 2012-12-19 16:08:13 UTC
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!
Comment 4 Aaron Plattner 2013-01-02 07:30:27 UTC
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.
Comment 5 Aaron Plattner 2013-01-03 17:59:07 UTC
Review of attachment 231832 [details] [review]:

Superseded
Comment 6 Robert Bragg 2013-01-07 13:48:48 UTC
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.
Comment 7 Neil Roberts 2013-01-07 16:40:42 UTC
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
Comment 8 Aaron Plattner 2013-01-07 17:45:29 UTC
Verified with commit f1baa4d60f1b48ee431c4aa78735baba8ec1d50b on the cogl-1.12 branch.  Thanks!