-
Notifications
You must be signed in to change notification settings - Fork 405
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
lfo display caching #7901
lfo display caching #7901
Conversation
* caches the display to a bitmap * only updates when parameters are changed or lua new code is applied
{ | ||
bool hasChanged = false; | ||
|
||
if (paramsFromLastDrawCall[lfodata->delay.param_id_in_scene].i != lfodata->delay.val.i) |
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.
Happy to merge this, but the lfo data has params which are contiguous so you could also make this code
auto *p = &lfodata->delay; // look in the definition of LFOStorage for which param is first
while (p <= &lfodata->shape) // and last
{
if (paramsFromLastDrawCa[[p->paramid].i != p->val.i;
hasChanged = true;
++p;
}
We rely on this contiguity in several parts of the code so while it is not in general in C++ safe, in this instance i tis.
type thing. If you want to make this change now I can wait but I'm also happy to merge.
Thanks for doing this!
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.
That is much cleaner. I was looking for a way of doing that but Couldn't figure out how. I'll fix it
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.
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.
rate is first and release is last yes.
Ahh I realized there's a few other places we invalidate from
I haven't had a chance to run it to test but from a review I worry those would leave the display improperly uncached |
nope those are not included. |
…o lfodisplay_caching
* Repaints on tempo changed * Repaints on MSEG editor change
addresses partially #7895