-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WaveformGraph
overhead when DrawPosition
is changed
#6009
Fix WaveformGraph
overhead when DrawPosition
is changed
#6009
Conversation
The previous attempt to fix this (ppy#5197) helped, but there were still some scenarios where invalidation would cause regeneration. Let's just do our own invalidation for now. One thing I'm not sure about is whether checking `DrawSize` here is enough (should I be using `ScreenSpaceDrawQuad.Size` instead?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The screenshots don't really make much sense as an observer to the issue, but I think it's fine.
// We should regenerate when `Scale` changed, but not `Position`. | ||
// Unfortunately both of these are grouped together in `MiscGeometry`. | ||
// Can't use invalidation for this as RequiredParentSizeToFit is closes, but also triggers on DrawPosition changes. | ||
if (lastGeneratedDrawSize != null && DrawSize != lastGeneratedDrawSize) | ||
queueRegeneration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment previously mentioned scale, but that's not included in DrawSize
. Perhaps it makes more sense this way, though? That is - when we think of scale it's usually in the context of stretching data and not generating new data for the stretched bounds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequiredParentSizeToFit = MiscGeometry | DrawSize
. MiscGeometry
invalidates on Scale
, so the comment made sense. I don't necessarily disagree with ignoring it though as you say.
Yeah it's subtle. See the spikes on the update thread, which occur every beat in the editor. |
As a side note, Can there maybe be a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with this for now
To speed things up I'm just gonna leave that for the next time we touch that I think. Or a separate PR. |
The previous attempt to fix this (#5197) helped, but there were still some scenarios where invalidation would cause regeneration.
Let's just do our own invalidation for now.
One thing I'm not sure about is whether checking
DrawSize
here is enough (should I be usingScreenSpaceDrawQuad.Size
instead?).Closes ppy/osu#24951