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

fix: consider array size on canvaskit shader data #49754

Merged
merged 3 commits into from Feb 15, 2024

Conversation

renancaraujo
Copy link
Contributor

@renancaraujo renancaraujo commented Jan 12, 2024

This PR changes the ShaderData construction on canvaskit to consider array uniforms.

flutter/flutter#141296

flutter/flutter#141838

Pre-launch Checklist

  • 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 and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jan 12, 2024
@renancaraujo
Copy link
Contributor Author

renancaraujo commented Jan 12, 2024

Still missing some tests, thats why its draft.

@jonahwilliams
Copy link
Member

This looks like the right change! In terms of testing, we have a test file: https://github.com/flutter/engine/blob/main/lib/web_ui/test/canvaskit/fragment_program_test.dart

You could copy down the JSON format for a shader with array uniform and assert that it had the correct structure?

@renancaraujo

This comment was marked as outdated.

@renancaraujo renancaraujo force-pushed the renan/canvaskit branch 2 times, most recently from a431ed9 to 81576f8 Compare February 5, 2024 19:19
@renancaraujo renancaraujo marked this pull request as ready for review February 5, 2024 19:20
@renancaraujo
Copy link
Contributor Author

renancaraujo commented Feb 5, 2024

Hello mr @jonahwilliams , updated the PR with tests and fixed flutter/flutter#141838

@jonahwilliams
Copy link
Member

Thanks, i will try and take a look this week - but I'm at a conference today and tomorrow so there will be some delay.

}
uniforms[location] = UniformData(
uniforms[i] = UniformData(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewer: Attention to this change, in the current impl we get an out of bounds error as the location value also considers the array size.

* Use the original kJsonIPLR shader source and metadata to match the test expectations
* Make kJsonArrayIPLR a Dart raw string
Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 15, 2024
@auto-submit auto-submit bot merged commit c720046 into flutter:main Feb 15, 2024
26 checks passed
sealesj pushed a commit to sealesj/engine that referenced this pull request Feb 15, 2024
This PR changes the ShaderData construction on canvaskit to consider array uniforms. 

flutter/flutter#141296

flutter/flutter#141838

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 16, 2024
jason-simmons added a commit to jason-simmons/flutter that referenced this pull request Feb 16, 2024
2024-02-15 30870216+gaaclarke@users.noreply.github.com Added tool to easily check golden diffs locally. (flutter/engine#50654)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 4bbf2060b008 to 12d0b7fac4c3 (2 revisions) (flutter/engine#50689)
2024-02-15 johnoneil@users.noreply.github.com Provide a matrix inverse shim for GLES 2.0. (flutter/engine#50545)
2024-02-15 jonahwilliams@google.com [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 682f0e1e7e77 to 4bbf2060b008 (3 revisions) (flutter/engine#50686)
2024-02-15 103135467+sealesj@users.noreply.github.com Pin OSV-Scanner reusable workflow (flutter/engine#50649)
2024-02-15 whesse@google.com Add support for dart_src GN variable to flutter_frontend_server build (flutter/engine#50685)
2024-02-15 6718144+renancaraujo@users.noreply.github.com fix: consider array size on canvaskit shader data (flutter/engine#49754)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 1277910beec9 to 682f0e1e7e77 (1 revision) (flutter/engine#50683)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 85ab600a9519 to 1277910beec9 (2 revisions) (flutter/engine#50682)
jason-simmons added a commit to jason-simmons/flutter that referenced this pull request Feb 16, 2024
2024-02-15 30870216+gaaclarke@users.noreply.github.com Added tool to easily check golden diffs locally. (flutter/engine#50654)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 4bbf2060b008 to 12d0b7fac4c3 (2 revisions) (flutter/engine#50689)
2024-02-15 johnoneil@users.noreply.github.com Provide a matrix inverse shim for GLES 2.0. (flutter/engine#50545)
2024-02-15 jonahwilliams@google.com [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 682f0e1e7e77 to 4bbf2060b008 (3 revisions) (flutter/engine#50686)
2024-02-15 103135467+sealesj@users.noreply.github.com Pin OSV-Scanner reusable workflow (flutter/engine#50649)
2024-02-15 whesse@google.com Add support for dart_src GN variable to flutter_frontend_server build (flutter/engine#50685)
2024-02-15 6718144+renancaraujo@users.noreply.github.com fix: consider array size on canvaskit shader data (flutter/engine#49754)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 1277910beec9 to 682f0e1e7e77 (1 revision) (flutter/engine#50683)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 85ab600a9519 to 1277910beec9 (2 revisions) (flutter/engine#50682)
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 16, 2024
2024-02-15 30870216+gaaclarke@users.noreply.github.com Added tool to easily check golden diffs locally. (flutter/engine#50654)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 4bbf2060b008 to 12d0b7fac4c3 (2 revisions) (flutter/engine#50689)
2024-02-15 johnoneil@users.noreply.github.com Provide a matrix inverse shim for GLES 2.0. (flutter/engine#50545)
2024-02-15 jonahwilliams@google.com [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 682f0e1e7e77 to 4bbf2060b008 (3 revisions) (flutter/engine#50686)
2024-02-15 103135467+sealesj@users.noreply.github.com Pin OSV-Scanner reusable workflow (flutter/engine#50649)
2024-02-15 whesse@google.com Add support for dart_src GN variable to flutter_frontend_server build (flutter/engine#50685)
2024-02-15 6718144+renancaraujo@users.noreply.github.com fix: consider array size on canvaskit shader data (flutter/engine#49754)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 1277910beec9 to 682f0e1e7e77 (1 revision) (flutter/engine#50683)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 85ab600a9519 to 1277910beec9 (2 revisions) (flutter/engine#50682)
renancaraujo added a commit to renancaraujo/engine that referenced this pull request Apr 25, 2024
This PR changes the ShaderData construction on canvaskit to consider array uniforms. 

flutter/flutter#141296

flutter/flutter#141838

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
GiacomoPignoni pushed a commit to plexagon/engine that referenced this pull request Apr 26, 2024
This PR changes the ShaderData construction on canvaskit to consider array uniforms.

flutter/flutter#141296

flutter/flutter#141838

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@rlealfacephi
Copy link

Hi @renancaraujo. Im just just fighting with same problem on flutter web with some custom shaders that works perfect on native platforms. Seams that all shaders with issues in my side has array uniforms. I just try today all flutter channels (master included), but any of the channels fix the problem. Your fix is working for you?

Appreciate your comments!!! :)

@renancaraujo
Copy link
Contributor Author

Hey @rlealfacephi now for me i was not able to reproduce the problem described in the issue. Would you open another issues decribing what is the output for you? Thanks.

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 platform-web Code specifically for the web engine
Projects
None yet
4 participants