Fix OpenGL support handling for plugins with dynamic GL support. #869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
OfxEffectInstance::onEnableOpenGLKnobValueChange() breaks rendering for plugins that change their OpenGL support based on the value of their parameters (e.g. OCIODisplay and friends). This method can cause "OpenGL enabled" render calls to be made on plugins that have explicitly stated they do not support OpenGL with their current parameter values. This function also violates the contract between host and plugin because it blindly changes the value of an instance property without the plugin having any way to know it happened or stop it. This logic is also not even needed because other logic in Node::getCurrentOpenGLRenderSupport() actually properly handles all the project, node, and plugin level overrides.
The following changes are include in this change:
Have you tested your changes (if applicable)? If so, how?
Yes. I verified that this change causes Natron to stop requesting GL renders from plugins, like OCIODisplay, that explicitly
state that they do not support GL requests given their current parameter values. I also verified that GL render calls are
made when the plugin signals that the parameter combination does allow GL support.
Futher details of this pull request
The following changes to the OCIO plugins also helped detect and verify these changes worked properly.
NatronGitHub/openfx-io#28
NatronGitHub/openfx-io#29