Ensure the render callback is always invoked #2079
Merged
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.
Changes proposed in this pull request
This PR changes the ShouldSkipIteration function logic to be UpdateSceneChanges that will return true if the scene has changed. This function was previously returning the opposite value than what it was supposed to do. I'm thus updating the different parts of the code that are calling it.
Also, the previous logic was this if there was nothing updated in the scene, we would return "Converging" instead of calling Render(), but that's not correct. We need this callback to be invoked even if nothing has changed in the scene, as this function just checks the render status and does the necessary if the render has finished, is restarting, etc.... The reason it was working was precisely because the logic in ShouldSkipIteration was inverted, and given the high amount of calls in this function where nothing has changed, we would end up calling Render() to do what's needed.
To clarify, I'm renaming the function
UpdateRender
and I'm putting everything under a switch of the render status, since that's what this function was supposed to do.Issues fixed in this pull request
Fixes #2078