Boost performance of groups with blend_mode != PassThrough - #1269
Merged
OverloadedOrama merged 8 commits intoJun 15, 2025
Conversation
OverloadedOrama
approved these changes
Jun 15, 2025
OverloadedOrama
left a comment
Member
There was a problem hiding this comment.
I tested it a bit and it works well. I think it should be fine to get merged for v1.1.2, it's a very welcome performance boost and it doesn't seem to be breaking anything. Thank you very much!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NOTE: This is a performance PR so this would need a little testing, also it should be merged after Pixelorama 1.1.2 gets released (just a preference, not a requirement)
Attempt at solving #1250. Boosts the performance of GroupLayers to roughly twice (47% to be precise) it's current state by introducing cache.
In consecutive generations, when the shader is same, calling
RenderingServer.material_set_shaderagain and again (ingenerate_image()) takes up unnecessary computation time (Which makes up most of the 47% time i talked about -- per generation). There is now a way to reuse the material in last generation for the next one.when a GroupLayer gets blended, if it has another GroupLayer as child, even if the contents of child GroupLayer didn't change, it ends up being re-blended regardless. To fix this there is now a cache which save time if the contents of a GroupLayer didn't change.
As it uses cache this takes up a little more memory but it's not noticeable.