-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Remove read from resolve capability to improve iOS performance. #47688
[Impeller] Remove read from resolve capability to improve iOS performance. #47688
Conversation
|
TODO: determine if the Flip allocations are already cached. |
|
Switch RT allocator. Note that this does not make MSAA textures non-transient. |
|
From testing locally on a iPhone 14 (I think). ToT: 250 ms GPU time. |
|
Woah -- any theories as to why flipping between two textures for the restore is faster than reusing the same one in this case? We need to wait for the previous pass to store before the backdrop can be read either way... Will TAL shortly |
|
I have no particular theories. Debugging with xcode frame capture in both cases shows that we're spending 99% of time in the gaussian blur. So it must be something like a synchronization deoptimization when reading from the onscreen, or perhaps the onscreen being wide gamut forces some additional conversions? |
|
Oh! IIRC the Metal docs give an ominous warning about reduced performance of readable onscreen textures, but I never considered that sampling from the onscreen texture might be super slow, which would make sense... If you instead just set SupportsReadFromOnscreenTexture to false for Metal and do nothing else, does that meet/exceed the performance of this patch? SupportsReadFromResolve seems like a cap check worth keeping around. |
|
Setting it to false accomplishes the same effect. If we're not using it though, then its still in the git history if we need to bring it back. |
|
Oh no, if we're not using a capability anywhere, we should for sure remove it. What I mean is getting rid of My suggestion was a route for easily testing it out: If you go to HEAD and just disable onscreen texture reads for Metal, does that cause the same performance improvement you're seeing with this patch? This can be tried by just setting |
|
I'm not sure what you mean, the only change in this PR is the removal of the capability. |
|
The capability you're removing is |
|
Just to further clarify: In terms of EntityPass' behavior, turning off Disabling just Disabling So if it turns out that avoiding onscreen texture i/o is the cause of the improvement, then |
|
Ahh sorry, I completely misread your comment. Yes, It seems like I confused read from resolve and read from onscreen - though disabling read from resolve had the same effect. From testing, the improvement is actually from disabling the read from onscreen - which I thought is what I did 😆
I will update this to actually remove the read from onscreen check. |
|
Yeah, redoing here: #47808 |
As discovered by @knopp in flutter/flutter#131567 (comment), this is actually reducing performance substantially when there are multiple blurs. In the case of flutter/flutter#132735 , removing this capbility improves GPU performance from 400ms per frame to ~100 ms per frame.
Fixes flutter/flutter#131567 (comment)