AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.34k stars 2.2k forks source link

Reduce Shader Jank #17104

Open jhimes144 opened 1 day ago

jhimes144 commented 1 day ago

Is your feature request related to a problem? Please describe.

When an Avalonia app rich with animations first opens, there is noticeable lag and stuttering with these animations on first run. This suboptimal experience continues until the user interacts enough with the UI until which point where all the shaders have had a chance to compile. For instance, the first time a modal opens it will stutter, but afterwards its fine.

Describe the solution you'd like

It would be nice if Avalonia had some sort of way to compile shaders at app start. Flutter (uses a skia backend) had the same issue. There solution to it is found here https://docs.flutter.dev/perf/shader

Over the years, Avalonia's performance has continue to improve. Its animation performance is beginning to rival that of UI solutions marketed towards games and real time apps, like NoesisGUI. I believe addressing shader jank would be the final nail.

Describe alternatives you've considered

No response

Additional context

No response

maxkatz6 commented 22 hours ago

When an Avalonia app rich with animations first opens, there is noticeable lag and stuttering with these animations on first run.

I would be confident, it's caused by JIT, and less so by shaders. And, for instance, R2R or AOT normally noticeably improve this experience.

Or do you have any specific hints that it's actually skia shaders.