Skip to content

Comments

Update web ui fragment shader tests#181877

Merged
auto-submit[bot] merged 4 commits intoflutter:masterfrom
walley892:web-shader-tests
Feb 11, 2026
Merged

Update web ui fragment shader tests#181877
auto-submit[bot] merged 4 commits intoflutter:masterfrom
walley892:web-shader-tests

Conversation

@walley892
Copy link
Contributor

Adds a bunch of tests for uniform setting functionality for custom fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were previously using the location, which is the integer offset of the uniform, not the offset in floats.

@walley892 walley892 requested a review from gaaclarke February 3, 2026 21:28
@github-actions github-actions bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels Feb 3, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an issue with uniform offset calculation in fragment shaders for the web, where the uniform's integer location was used instead of its float offset. The fix introduces a floatOffset property to UniformData and correctly calculates it in ShaderData. This fix is applied to both CanvasKit and SkWasm backends.

Additionally, the PR significantly refactors and expands the fragment shader tests. It adds a comprehensive suite of tests for various uniform types (float, vec2, vec3, vec4, and arrays) and different ways of setting them. This improves test coverage and reliability for custom fragment shaders on the web.

The changes look good and the fix is correct. I have a couple of minor suggestions for the test file to improve clarity.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

nice! thanks lgtm

@github-actions github-actions bot added the e: impeller Impeller rendering backend issues and features requests label Feb 4, 2026
@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 4, 2026
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 4, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 4, 2026

autosubmit label was removed for flutter/flutter/181877, because - The status or check suite Linux linux_web_engine_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 11, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Feb 11, 2026
Merged via the queue into flutter:master with commit 836c295 Feb 11, 2026
181 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 15, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 17, 2026
walley892 added a commit to walley892/flutter that referenced this pull request Feb 17, 2026
Adds a bunch of tests for uniform setting functionality for custom
fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were
previously using the `location`, which is the integer offset of the
uniform, not the offset in floats.
walley892 added a commit to walley892/flutter that referenced this pull request Feb 18, 2026
Adds a bunch of tests for uniform setting functionality for custom
fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were
previously using the `location`, which is the integer offset of the
uniform, not the offset in floats.
gaaclarke added a commit to gaaclarke/flutter that referenced this pull request Feb 18, 2026
Reland `Enabled some disabled impeller fragment shader dart tests` (flutter#180788)

relands flutter#180759

changes since revert:
1) waits for async tests now
1) keeps 2 tests that don't pass on impeller disabled

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Enables fragment shader test for impeller (fixes mat2 on vulkan) (flutter#181013)

This rearranges the packing of mat2 fields in structs which was causing
an existing fragment shader test to fail.

The test still doesn't work on Metal, but this PR fixes it for Vulkan. I
suspect the fix for metal may be similar but since the uniforms aren't
in a virtual struct the code isn't hitting this fix.

issue: flutter#180873

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Account for vec3 padding in Metal (flutter#181563)

Re-landing of flutter#181340
incorporating flutter#181550.

Vec3 uniforms on the metal backend are vec4-aligned. This PR accounts
for that padding.

---------

Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>

Fixes getUniformX for Vulkan (flutter#181286)

Does what it says on the tin!

This PR adds struct member information to the runtime flatbuffer format.
This allows dart code to introspect structs at runtime.

Also modifies the runtime_stage tests to verify formats for all
supported uniform types.

Bubbles up struct member information to dart, and uses that information
to grab struct members in `getUniformX` related functions. This is
necessary on Vulkan because all uniforms are packaged into a single
struct. Also re-enables tests

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

Organize and update fragment shader uniform tests. (flutter#181822)

Adds more comprehensive testing for setFloat and getUniform* on fragment
shaders.

Deletes redundant tests.

Fixes getUniformVecX indexing errors.

Update web ui fragment shader tests (flutter#181877)

Adds a bunch of tests for uniform setting functionality for custom
fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were
previously using the `location`, which is the integer offset of the
uniform, not the offset in floats.
gaaclarke added a commit to gaaclarke/flutter that referenced this pull request Feb 18, 2026
Reland `Enabled some disabled impeller fragment shader dart tests` (flutter#180788)

relands flutter#180759

changes since revert:
1) waits for async tests now
1) keeps 2 tests that don't pass on impeller disabled

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Enables fragment shader test for impeller (fixes mat2 on vulkan) (flutter#181013)

This rearranges the packing of mat2 fields in structs which was causing
an existing fragment shader test to fail.

The test still doesn't work on Metal, but this PR fixes it for Vulkan. I
suspect the fix for metal may be similar but since the uniforms aren't
in a virtual struct the code isn't hitting this fix.

issue: flutter#180873

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Account for vec3 padding in Metal (flutter#181563)

Re-landing of flutter#181340
incorporating flutter#181550.

Vec3 uniforms on the metal backend are vec4-aligned. This PR accounts
for that padding.

---------

Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>

Fixes getUniformX for Vulkan (flutter#181286)

Does what it says on the tin!

This PR adds struct member information to the runtime flatbuffer format.
This allows dart code to introspect structs at runtime.

Also modifies the runtime_stage tests to verify formats for all
supported uniform types.

Bubbles up struct member information to dart, and uses that information
to grab struct members in `getUniformX` related functions. This is
necessary on Vulkan because all uniforms are packaged into a single
struct. Also re-enables tests

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

Organize and update fragment shader uniform tests. (flutter#181822)

Adds more comprehensive testing for setFloat and getUniform* on fragment
shaders.

Deletes redundant tests.

Fixes getUniformVecX indexing errors.

Update web ui fragment shader tests (flutter#181877)

Adds a bunch of tests for uniform setting functionality for custom
fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were
previously using the `location`, which is the integer offset of the
uniform, not the offset in floats.
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
Adds a bunch of tests for uniform setting functionality for custom
fragment shaders on the web.

Deletes redundant tests.

Fixes a discovered issue in the uniform offset calculation. We were
previously using the `location`, which is the integer offset of the
uniform, not the offset in floats.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants