NatronGitHub / Natron

Open-source video compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
http://NatronGitHub.github.io
GNU General Public License v2.0
4.54k stars 332 forks source link

Fix rendering failures caused by not clearing the current context. #871

Closed acolwell closed 1 year ago

acolwell commented 1 year ago

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:

PR Description

What type of PR is this? (Check one of the boxes below)

What does this pull request do?

This patch fixes 2 bugs where code was leaving a GL context current when it shouldn't have. This was causing rendering failures because code would later try to use a context that was current on one thread to do rendering on another.

This patch contains the following changes:

Have you tested your changes (if applicable)? If so, how?

Yes. I've verified that this fixes "random" rendering failures I was seeing on Windows. I also created a unit test that verifies the fixes and run them on Windows and Linux. I don't have a Mac dev environment to test with, but the test should detect the same bugs on that platform. I verified the new tests fail without the fixes and pass with them.

rodlie commented 1 year ago

This pull breaks X11.

acolwell commented 1 year ago

This pull breaks X11.

Sorry about this. I'll try to look into this today. I figured the assert might smoke out other issues.

rodlie commented 1 year ago

No problem or rush :+1: