-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Respect max supported texture size when allocating glyph atlas texture. #45992
Conversation
…tlas texture. The earlier limit of 4096u was pessimistically small on some backends and too big on others (like older versions of OpenGL ES). The former would stop glpyhs from rendering when they got sufficiently large or numerous. The latter would cause errors on texture allocation. The full fix is tracked in flutter/flutter#133092
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 or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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. |
Drive-by workaround for flutter/flutter#134292 |
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.
- Can we have a test for this? i.e. something in typopgrapher that creates glyphs of a known size closer to the max texture limit or something?
Or a test that adds glyphs until it fails and checks that the size is the max texture limit?
- Did you verify this fixes the linked issue? This will definitely improve things but I'm not sure if we also need to do @bdero 's fix for multiple atlas textures.
Yeah, this improves things but I am more worried about the OpenGL backend where the min size is lower. Instead of not rendering more glyphs, I believe not being able to allocate the texture will lead to rasterizer teardown. Just wanted to get ahead of this badness. @bdero fix is definitely necessary. This just prevents the teardown on OpenGL ES and improves things on Metal. We can add the testing there as this will interact with typography and capabilities and will be reworked soon hopefully. |
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.
Change LGTM.
We could probably capture this in a Metal golden by trying to render a bunch of big emojis on Metal -- that'd trip a validation failure past the 4096 limit when is this change isn't present. That being said, that would be a somewhat lousy test due to the environment dependence. We'd really need a fake/mock context to bake this behavior down into a reliable test.
Maybe the fact that our existing text goldens continue not breaking is OK for now.
glyph_positions, // | ||
atlas_context, // | ||
type, // | ||
context.GetResourceAllocator()->GetMaxTextureSizeSupported() // |
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.
Oh nice, I didn't realize we had this yet.
} while (current_size.width <= kMaxAtlasSize && | ||
current_size.height <= kMaxAtlasSize); | ||
} while (current_size.width <= max_texture_size.width && | ||
current_size.height <= max_texture_size.height); |
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.
Can you also add this change to the STB backend? It's similarly pinned to an arbitrary texture size.
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.
Oh, my bad. Didn't notice this call to action. Filing a followup.
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.
Filed #46010
Gets rid of the hardcoded 2048 px size. Followup from review comment left unaddressed in flutter#45992. Missing this will be less easy after flutter/flutter#133029.
…ng glyph atlas texture. (flutter/engine#45992)
…ng glyph atlas texture. (flutter/engine#45992)
Gets rid of the hardcoded 2048 px size. Followup from review comment left unaddressed in #45992. Missing this will be less easy after flutter/flutter#133029.
…ng glyph atlas texture. (flutter/engine#45992)
…ng glyph atlas texture. (flutter/engine#45992)
…134998) flutter/engine@e1c784e...589bde9 2023-09-19 skia-flutter-autoroll@skia.org Roll Skia from 4122791099ce to 744807d740c7 (1 revision) (flutter/engine#46019) 2023-09-19 jonahwilliams@google.com [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673) 2023-09-19 chinmaygarde@google.com [Impeller] Fix STB backend to account for max texture sizes. (flutter/engine#46010) 2023-09-19 matanlurey@users.noreply.github.com [Impeller] Hold the CommandPoolVK at a higher scope. (flutter/engine#46013) 2023-09-19 skia-flutter-autoroll@skia.org Roll Skia from 0c990ab9e097 to 4122791099ce (19 revisions) (flutter/engine#46016) 2023-09-18 kjlubick@users.noreply.github.com Add missing include of SkPath (flutter/engine#45996) 2023-09-18 chinmaygarde@google.com [Impeller] Respect max supported texture size when allocating glyph atlas texture. (flutter/engine#45992) 2023-09-18 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 3_Lh8otTpmVuf-Zwb... to qy5FU4y6sx1FscCpd... (flutter/engine#45998) 2023-09-18 chris@bracken.jp Revert "[Windows] Update vsync on raster thread (#45310)" (flutter/engine#46000) 2023-09-18 matanlurey@users.noreply.github.com Provide a default `--target-variant` for `clang_tidy`. (flutter/engine#45909) 2023-09-18 ychris@google.com Revert "[ios] use python script to generate extension safe frameworks and code sign them" (flutter/engine#46004) 2023-09-18 john@johnmccutchan.com Disable HardwareBuffer backed Platform Views temporarily (flutter/engine#45986) 2023-09-18 john@johnmccutchan.com Tighten up ImageReaderPlatformViewRenderTarget code (flutter/engine#45889) 2023-09-18 ychris@google.com [ios] use python script to generate extension safe frameworks and code sign them (flutter/engine#45781) 2023-09-18 bdero@google.com Bump impeller-cmake to HEAD. (flutter/engine#45953) 2023-09-18 31859944+LongCatIsLooong@users.noreply.github.com [iOS] Remove selectionDidChange call in UndoManager (flutter/engine#45657) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 3_Lh8otTpmVu to qy5FU4y6sx1F If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#134998) flutter/engine@e1c784e...589bde9 2023-09-19 skia-flutter-autoroll@skia.org Roll Skia from 4122791099ce to 744807d740c7 (1 revision) (flutter/engine#46019) 2023-09-19 jonahwilliams@google.com [Android] Add support for setting thread affinity based on core speed. (flutter/engine#45673) 2023-09-19 chinmaygarde@google.com [Impeller] Fix STB backend to account for max texture sizes. (flutter/engine#46010) 2023-09-19 matanlurey@users.noreply.github.com [Impeller] Hold the CommandPoolVK at a higher scope. (flutter/engine#46013) 2023-09-19 skia-flutter-autoroll@skia.org Roll Skia from 0c990ab9e097 to 4122791099ce (19 revisions) (flutter/engine#46016) 2023-09-18 kjlubick@users.noreply.github.com Add missing include of SkPath (flutter/engine#45996) 2023-09-18 chinmaygarde@google.com [Impeller] Respect max supported texture size when allocating glyph atlas texture. (flutter/engine#45992) 2023-09-18 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 3_Lh8otTpmVuf-Zwb... to qy5FU4y6sx1FscCpd... (flutter/engine#45998) 2023-09-18 chris@bracken.jp Revert "[Windows] Update vsync on raster thread (flutter#45310)" (flutter/engine#46000) 2023-09-18 matanlurey@users.noreply.github.com Provide a default `--target-variant` for `clang_tidy`. (flutter/engine#45909) 2023-09-18 ychris@google.com Revert "[ios] use python script to generate extension safe frameworks and code sign them" (flutter/engine#46004) 2023-09-18 john@johnmccutchan.com Disable HardwareBuffer backed Platform Views temporarily (flutter/engine#45986) 2023-09-18 john@johnmccutchan.com Tighten up ImageReaderPlatformViewRenderTarget code (flutter/engine#45889) 2023-09-18 ychris@google.com [ios] use python script to generate extension safe frameworks and code sign them (flutter/engine#45781) 2023-09-18 bdero@google.com Bump impeller-cmake to HEAD. (flutter/engine#45953) 2023-09-18 31859944+LongCatIsLooong@users.noreply.github.com [iOS] Remove selectionDidChange call in UndoManager (flutter/engine#45657) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 3_Lh8otTpmVu to qy5FU4y6sx1F If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Has this made it into a stable release of Flutter yet? I am trying to determine if the issue I'm seeing in Fintasys/emoji_picker_flutter#159 may be mitigated by this change, or if there is still an issue. Can we count on |
…tlas texture. (#45992) The earlier limit of 4096u was pessimistically small on some backends and too big on others (like older versions of OpenGL ES). The former would stop glpyhs from rendering when they got sufficiently large or numerous. The latter would cause errors on texture allocation. The full fix is tracked in flutter/flutter#133092
Gets rid of the hardcoded 2048 px size. Followup from review comment left unaddressed in #45992. Missing this will be less easy after flutter/flutter#133029.
The earlier limit of 4096u was pessimistically small on some backends and too big on others (like older versions of OpenGL ES). The former would stop glpyhs from rendering when they got sufficiently large or numerous. The latter would cause errors on texture allocation.
The full fix is tracked in flutter/flutter#133092