You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Impeller] Parts of application flickering with blur present on main. #131490
We have parts of application flickering with blur present when tested on main. Though it's possible that the blur causes the issue indirectly by making the rasterisation taking longer.
Can you share some details of the application? We really need to be able to reproduce this so we can figure out where the problem is occuring.
My read of how presentation works on iOS supports the current strategy we're using and I none of us have seen this issue, even on applications which have much longer CPU or GPU frame times. It could be that there is some other timing issue, and the waitUntilScheduled is acting like a sleep and causing us to win the race.
I'll try to isolate this. One thing I noticed - there are two blurs in the application. I disabled all paths (to rule out tesselator) but the performance is still problematic with impeller (fine with Skia)
I noticed quite a few allocations when rendering offscreen. This is for one second:
For every frame there is one 12MB ImpellerOnScreen Stencil Texture allocated/deallocated and a number of EntityPass Color textures (1.8MB each).
Is this expected behavior? These per-frame allocations don't happen with Skia. I assume it caches the textures used for offscreen rendering.
When blurs are applied as backdrop filters specifically, we currently need to end the current render pass in order to read from the backdrop and blur it into a smaller offscreen texture. This requires us to store the multisample stencil in addition to the color texture in-between passes in order to retain the clip state.
The best way forward would be to share a reproduction that demonstrates clearly worse performance than Skia (in a new issue) so that we can take a closer look. There are still potential optimization tricks on the table for backdrop blurs that we could explore depending on how the app is using blurs.
It sounds like you're hitting a worst case scenario with the backdrop filter and we're allocating/storing the fullscreen multisample stencil buffer every frame. I think we can obviously do better there, but it would be best to have a repro of your app to make sure that's the primary pathology of your perf issue.
changed the title [-]Parts of application flickering with blur present on main[/-][+][Impeller] Parts of application flickering with blur present on main.[/+]on Jul 28, 2023
Thanks! I have a few ideas here. Worst comes to worst we can just add back the waitUntilScheduled but I think we should be able to retain having more frames in flight for applications that aren't bottlenecked elsewhere.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
knopp commentedon Jul 28, 2023
For reference, this is on iPhone 13 Pro.
jonahwilliams commentedon Jul 28, 2023
Can you share some details of the application? We really need to be able to reproduce this so we can figure out where the problem is occuring.
My read of how presentation works on iOS supports the current strategy we're using and I none of us have seen this issue, even on applications which have much longer CPU or GPU frame times. It could be that there is some other timing issue, and the waitUntilScheduled is acting like a sleep and causing us to win the race.
knopp commentedon Jul 28, 2023
I'll try to isolate this. One thing I noticed - there are two blurs in the application. I disabled all paths (to rule out tesselator) but the performance is still problematic with impeller (fine with Skia)
I noticed quite a few allocations when rendering offscreen. This is for one second:
For every frame there is one 12MB ImpellerOnScreen Stencil Texture allocated/deallocated and a number of EntityPass Color textures (1.8MB each).
Is this expected behavior? These per-frame allocations don't happen with Skia. I assume it caches the textures used for offscreen rendering.
bdero commentedon Jul 28, 2023
When blurs are applied as backdrop filters specifically, we currently need to end the current render pass in order to read from the backdrop and blur it into a smaller offscreen texture. This requires us to store the multisample stencil in addition to the color texture in-between passes in order to retain the clip state.
The best way forward would be to share a reproduction that demonstrates clearly worse performance than Skia (in a new issue) so that we can take a closer look. There are still potential optimization tricks on the table for backdrop blurs that we could explore depending on how the app is using blurs.
bdero commentedon Jul 28, 2023
It sounds like you're hitting a worst case scenario with the backdrop filter and we're allocating/storing the fullscreen multisample stencil buffer every frame. I think we can obviously do better there, but it would be best to have a repro of your app to make sure that's the primary pathology of your perf issue.
knopp commentedon Jul 28, 2023
I understand the need for these textures, just expected them to be reused across frames. I'll try to put together minimal reproducible example.
[-]Parts of application flickering with blur present on main[/-][+][Impeller] Parts of application flickering with blur present on main.[/+]knopp commentedon Jul 28, 2023
The following code can reproduce (iPhone 13 Pro, profile mode, current main) both the flickering and degraded performance compared to skia:
impeller-flicker.mov
jonahwilliams commentedon Jul 28, 2023
Thanks! I have a few ideas here. Worst comes to worst we can just add back the waitUntilScheduled but I think we should be able to retain having more frames in flight for applications that aren't bottlenecked elsewhere.
[Impeller] revert removal of wait until scheduled. (#44121)
[Impeller] revert removal of wait until scheduled. (flutter-team-arch…
[CP][Impeller] revert removal of wait until scheduled. (#44121) (#44122)
github-actions commentedon Aug 12, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[Impeller] revert removal of wait until scheduled. (flutter-team-arch…
[Impeller] revert removal of wait until scheduled. (flutter-team-arch…