Repository navigation
refactor: egui sink - #106
bits0rcerer wants to merge 9 commits into
Conversation
gui cpu usage from ≈45% -> ≈20%
6998bd9 to
f02fbe6
Compare
There was a problem hiding this comment.
Thanks for fixing this, looks good on my machine as well 👍
Looks like the new approach uses more CPU (compared to main). But I'm not knowledgeable of all this, so I trust you :)
As it changes the parser, I tried benchmarking the change but I had too much noise and I think this is fine, as we basically replace rgba & 0x00ff_ffff with rgba | 0xff00_0000, which should be the same in terms of performance.
One last question that came up.
| @@ -1,3 +1,5 @@ | |||
| #![recursion_limit = "256"] | |||
There was a problem hiding this comment.
Is this still needed? I tested it and from a quick glance it looks like it works fine without.
If needed could you please add a comment why we need this? (same above)
There was a problem hiding this comment.
... aswell but CI fails without it.
https://github.com/sbernauer/breakwater/actions/runs/35897295535/job/107304289914#step:6:1880
There was a problem hiding this comment.
Looks like the new approach uses more CPU (compared to main). But I'm not knowledgeable of all this, so I trust you :)
yeah, according to my test (run and look in btop)
main: 19% cpu on idleusing only egui facilities: 45% cpu on idleegui facilities with cutsom wgpu upload: saves one copy and loop through the canvas bytes and brings the performance back to: 20% cpu on idle
main currently uses custom rendering with the glow (opengl) backend. This PR uses the egui default backend wgpu (vulkan, metal, ...).
wgpu might be more desirable since it is more portable in terms compatibility with graphics apis.
On the other hand is currently real the performance regression worth the potential benefits of less code, more aligned with egui standards and newer graphics api?
What do you think?
There was a problem hiding this comment.
When upgrading nightly on my machine I ran into the same recursion warning locally. I took the liberty of adding an explanatory comment generated by a friend 🙊
I have no opinion and knowledge on egui, as mentioned I trust you :)
I approved the PR, you can merge when you want.



This PR aims to replace the custom canvas renderer by allocating/updating a texture managed by egui and displaying it as an egui image.
Bonus: our alpha values where always zero making the canvas theoretically always invisible. Now they are always 255.