Allow to do DrawNode invalidation on cached BufferedContainer without redrawing the framebuffer#6404
Conversation
... when it is cached and Invalidate(Invalidation.DrawNode) is called, and also when ForceRedraw() is called.
Framebuffer redraw now needs to be explicitly requested by calling ForceRedraw() on the BufferedContainer when its cached. It is also automatically triggered when the source of Invalidation.DrawNode is a child.
|
Is there a specific reason why this is in draft? Seems like it's ready for review according to my eyes? |
|
I'm not sure the game-side feature proposal has been universally accepted, and this pull only makes sense in context of it, so I wouldn't disagree with draft. For one I don't really see the point of this entire PR series so I'm not touching it. |
| if ((invalidation & Invalidation.DrawNode) > 0) | ||
| { | ||
| ++updateVersion; | ||
| if (source == InvalidationSource.Child) |
There was a problem hiding this comment.
Note that this will only work for immediate children, because Child invalidations currently don't propagate all the way to the root.
|
|
||
| if ((invalidation & Invalidation.DrawNode) > 0) | ||
| { | ||
| ++updateVersion; |
There was a problem hiding this comment.
Additionally, we'll need to make sure this doesn't break any existing cases (or figure out how to fix those). I believe this currently means changing Padding or adding a child will redraw?
There was a problem hiding this comment.
Added tests for Padding and adding new internal child, and no, they don't cause redraw. However, it doesn't cause redraw in master (bc83409) either.
I don't know if I should push those tests since they are failing, but it's not caused by this change, so for now - you can find them here: Uncomfy/osu-framework@buffered_container_explicit_framebuffer_redraw...buffered_container_extra_tests
|
@Uncomfy I noticed you updated your PRs but they are still in draft. Is there a reason they are draft? |
I fear that propagating the color from |
This is needed for changing the parameters of a custom shader on
BufferedContainerwithout tanking the performance (example: ppy/osu#30391 (comment))Cached framebuffer is redrawn only if DrawNode invalidation comes from a child or if it is explicitly requested via
ForceRedraw()method.Companion to ppy/osu#30391