-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Switch back to shared buffer UI image uploading on iOS #42333
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
dnfield
left a comment
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.
We can use the sync switch for this.
| #ifdef FML_OS_IOS | ||
| std::tie(image, decode_error) = UploadTextureToPrivate( | ||
| context, bitmap_result.device_buffer, bitmap_result.image_info); | ||
| #else |
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.
Instead of this, you can use the GPU sync switch to conditionally use this path on iOS.
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.
You need to disable mipmaps as well
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.
I mentioned mipmaps in the description.
The blit pass that generates the mipmaps still fails if the app is backgrounded, but not writing all the mip levels is safe for Metal and Vulkan -- GLES is the problem child.
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.
On some versions of iOS we've seen crashes when accessing command encoders in the background
|
I believe @dnfield is preparing a different patch for this with a test. So I'm gonna hold off on touching up this PR for the moment. |
|
Closing in favor of #42349 |
Resolves flutter/flutter#126878.
This is just a soft revert of the new blit upload path that was added in #40410.
Switches back to uploading via
SetContents. The blit pass that generates the mipmaps still fails if the app is backgrounded, but not writing all the mip levels is safe for Metal and Vulkan -- GLES is the problem child.The downside of course is that we lose lossy compression for the time being (supported on Family 8/A15/iPhone 13 and above). Perhaps we can come back around to this and add, say, a command buffer queue that defers execution until apps are foregrounded.