Skip to content
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

[framework] reduce ink sparkle uniform count. #133897

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Sep 2, 2023

Fixes #133325

Due to the number of uniforms present, the ink_sparkle shader can't run without post processing (on all target platforms) that the impellerc offline compiler doesn't perform. However, we can't just move the uniforms into a uniform buffer object (UBO) because the Skia backend doesn't support it.

Rather than work around this in the compiler, we can reduce the uniform count by 1) packing four floats into a single vec4 2) removing a uniform for what is effectively a constant.

This should have no visible effects, and if any scubas fail it means I did this wrong 😆

@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.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Sep 2, 2023
@Hixie
Copy link
Contributor

Hixie commented Sep 2, 2023

test-exempt: code refactor with no semantic change

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 6, 2023
@jonahwilliams
Copy link
Member Author

This is waiting on the g3 roll to catch up 🤷

@chinmaygarde chinmaygarde added the e: impeller Impeller rendering backend issues and features requests label Sep 8, 2023
layout(location = 15) uniform vec2 u_rotation2;
layout(location = 16) uniform vec2 u_rotation3;
// u_alpha, u_sparkle_alpha, u_blur, u_radius_scale
layout(location = 1) uniform vec4 u_composite_1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive by comment: The brittle-ness of specifying locations explicitly and then matching the same in Dart code seems egregious. The compiler auto-generates these and produces metdata. The C++ side uses this metadata for example. Perhaps we could do the same for Dart?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to be the next lemming to walk off the cliff of getting Dart code gen to work, be my guest, however I will not be working on this 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of something along the lines of JSON file that is read at runtime that contains a mapping between uniform names and their locations.

But, I must admit I haven't been burned by attempts to get Dart code-gen to work... yet. Perhaps why we can document why it sucks. We are generating code in C++ and I'd say it has worked... fine? Are we talking about specific challenges with Dart that will make it way harder than the engine C++ setup?

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 13, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Sep 13, 2023

auto label is removed for flutter/flutter/133897, due to - The status or check suite Mac build_tests_4_4 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@jonahwilliams
Copy link
Member Author

The google testing shard has continued to fail due to timeouts on g3 infra. I've marked it as passing and will land it.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 13, 2023
@auto-submit auto-submit bot merged commit 2daf917 into flutter:master Sep 13, 2023
67 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 14, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 14, 2023
flutter/flutter@61b890b...58ba6c2

2023-09-14 engine-flutter-autoroll@skia.org Roll Packages from 06cd9e9 to 275b76c (1 revision) (flutter/flutter#134734)
2023-09-14 dacoharkes@google.com Update plugin_ffi generated file to match FFIgen 9.0.0 (flutter/flutter#134614)
2023-09-14 jmccandless@google.com LinkedText (Linkify) (flutter/flutter#125927)
2023-09-14 polinach@google.com _DayPicker should build days using separate stetefull widget _Day. (flutter/flutter#134607)
2023-09-13 31859944+LongCatIsLooong@users.noreply.github.com Remove `Path.combine` call from `CupertionoTextSelectionToolbar` (flutter/flutter#134369)
2023-09-13 katelovett@google.com Update KeepAlive.debugTypicalAncestorWidgetClass (flutter/flutter#133498)
2023-09-13 84124091+opxdelwin@users.noreply.github.com Fix null check crash by ReorderableList (flutter/flutter#132153)
2023-09-13 engine-flutter-autoroll@skia.org Roll Flutter Engine from 154d6fd601a3 to cd90cc8469fb (3 revisions) (flutter/flutter#134691)
2023-09-13 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.5 to 2.21.6 (flutter/flutter#134692)
2023-09-13 engine-flutter-autoroll@skia.org Roll Flutter Engine from b71b366e3de3 to 154d6fd601a3 (6 revisions) (flutter/flutter#134683)
2023-09-13 christopherfujino@gmail.com [flutter_tools] Run ShutdownHooks when handling signals (flutter/flutter#134590)
2023-09-13 jhy03261997@gmail.com Dispose routes in navigator when throwing exception (flutter/flutter#134596)
2023-09-13 jonahwilliams@google.com [framework] reduce ink sparkle uniform count. (flutter/flutter#133897)
2023-09-13 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5e671d5c90f9 to b71b366e3de3 (4 revisions) (flutter/flutter#134676)
2023-09-13 15619084+vashworth@users.noreply.github.com Set the CONFIGURATION_BUILD_DIR in generated xcconfig when debugging core device (flutter/flutter#134493)
2023-09-13 zanderso@users.noreply.github.com Bump gradle heap size limit in *everywhere* (flutter/flutter#134665)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
Fixes flutter#133325

Due to the number of uniforms present, the ink_sparkle shader can't run without post processing (on all target platforms) that the impellerc offline compiler doesn't perform. However, we can't just move the uniforms into a uniform buffer object (UBO) because the Skia backend doesn't support it.

Rather than work around this in the compiler, we can reduce the uniform count by 1) packing four floats into a single vec4 2) removing a uniform for what is effectively a constant.

This should have no visible effects, and if any scubas fail it means I did this wrong �
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller Impeller rendering backend issues and features requests f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Impeller] ink_sparkle.frag has too many bindings to run on iOS simulators.
5 participants