Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@bdero
Copy link
Member

@bdero bdero commented May 26, 2023

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.

@bdero bdero self-assigned this May 26, 2023
@flutter-dashboard
Copy link

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.

Copy link
Contributor

@dnfield dnfield left a 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.

Comment on lines -455 to -458
#ifdef FML_OS_IOS
std::tie(image, decode_error) = UploadTextureToPrivate(
context, bitmap_result.device_buffer, bitmap_result.image_info);
#else
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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

@bdero
Copy link
Member Author

bdero commented May 26, 2023

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.

@bdero
Copy link
Member Author

bdero commented May 26, 2023

Closing in favor of #42349

@bdero bdero closed this May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Images becomes pink when launching from background

3 participants