Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

Part of #161209

Many Adreno 6XX are having trouble compiling the PorterDuff and ConicalGradient Pipeline. This rewrites the former to use specialization constants to reduce runtime branches. From testing on an S9+, this is sufficient to get it to compile correctly.

As a bonus, this should be faster... though it adds more shaders.

@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, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Jan 7, 2025
Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

I might get @gaaclarke to do a better C++ review, but I could imagine something like:

enum class PorterDuffMode {
  Clear,
  Source,
  Destination,
  SourceOver,
  DestinationOver,
  SourceIn,
  DestinationIn,
  SourceOut,
  DestinationOut,
  SourceATop,
  DestinationATop,
  Xor,
  Plus,
  Modulate,
  Screen,
};

template <typename Scalar>
std::array<std::vector<Scalar>, 15> GetPorterDuffSpecConstants(
    bool supports_decal) {
  Scalar x = supports_decal ? 1 : 0;
  return {{
      {x, 0, 0, 0, 0, 0},    // Clear
      {x, 1, 0, 0, 0, 0},    // Source
      {x, 0, 0, 1, 0, 0},    // Destination
      {x, 1, 0, 1, -1, 0},   // SourceOver
      {x, 1, -1, 1, 0, 0},   // DestinationOver
      {x, 0, 1, 0, 0, 0},    // SourceIn
      {x, 0, 0, 0, 1, 0},    // DestinationIn
      {x, 1, -1, 0, 0, 0},   // SourceOut
      {x, 0, 0, 1, -1, 0},   // DestinationOut
      {x, 0, 1, 1, -1, 0},   // SourceATop
      {x, 1, -1, 0, 1, 0},   // DestinationATop
      {x, 1, -1, 1, -1, 0},  // Xor
      {x, 1, 0, 1, 0, 0},    // Plus
      {x, 0, 0, 0, 0, 1},    // Modulate
      {x, 0, 0, 1, 0, -1},   // Screen
  }};
}

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #161273 at sha 8152719

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Jan 8, 2025
src * (frag_info.src_coeff + dst.a * frag_info.src_coeff_dst_alpha) +
dst * (frag_info.dst_coeff + src.a * frag_info.dst_coeff_src_alpha +
src * frag_info.dst_coeff_src_color);
frag_color = f16vec4(src * (src_coeff + dst.a * src_coeff_dst_alpha) +
Copy link
Member

Choose a reason for hiding this comment

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

nit; but just a nice documentation trail:
// see GetPorterDuffSpecConstants for actual constants

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jonahwilliams
Copy link
Contributor Author

yay goldens work!

@jonahwilliams jonahwilliams added autosubmit Merge PR when tree becomes green via auto submit App and removed will affect goldens Changes to golden files labels Jan 8, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jan 8, 2025
Merged via the queue into flutter:master with commit b5df290 Jan 8, 2025
180 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 8, 2025
@jonahwilliams jonahwilliams deleted the fix_shitty_phone_222 branch January 8, 2025 06:29
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
@jtmcdole
Copy link
Member

jtmcdole commented Jan 8, 2025

Reason for revert: tree broken:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8726329921123044593/+/u/run_new_gallery_opengles_impeller__transition_perf/stdout

[2025-01-07 23:23:30.242453] [STDOUT] stdout: [        ] signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
[2025-01-07 23:23:30.242492] [STDOUT] stdout: [        ] Abort message: '[FATAL:flutter/impeller/renderer/backend/gles/render_pass_gles.cc(626)] Check failed: result. Must be able to encode GL commands without error.'
[2025-01-07 23:23:30.244013] [STDOUT] stdout: [   +1 ms]     x0  0000000000000000  x1  0000000000005aa2  x2  0000000000000006  x3  0000007600613770
[2025-01-07 23:23:30.244206] [STDOUT] stdout: [        ]     x4  71647164636d6471  x5  71647164636d6471  x6  71647164636d6471  x7  7f7f7f7f7f7f7f7f
[2025-01-07 23:23:30.244287] [STDOUT] stdout: [        ]     x8  00000000000000f0  x9  000000791f64c090  x10 0000000000000001  x11 000000791f695f00
[2025-01-07 23:23:30.244335] [STDOUT] stdout: [        ]     x12 0000007600612590  x13 0000000000000091  x14 0000007600612640  x15 000000004cec4ec5
[2025-01-07 23:23:30.244372] [STDOUT] stdout: [        ]     x16 000000791f702d08  x17 000000791f6de810  x18 00000075f6126000  x19 00000000000000ac
[2025-01-07 23:23:30.244676] [STDOUT] stdout: [        ]     x20 00000000000000b2  x21 0000000000005a81  x22 0000000000005aa2  x23 00000000ffffffff
[2025-01-07 23:23:30.244710] [STDOUT] stdout: [        ]     x24 0000007600613a20  x25 b40000768f5e6ed0  x26 0000000000000150  x27 b40000787f583958
[2025-01-07 23:23:30.244728] [STDOUT] stdout: [        ]     x28 b40000782f53a9f0  x29 00000076006137f0
[2025-01-07 23:23:30.244766] [STDOUT] stdout: [        ]     lr  000000791f686414  sp  0000007600613750  pc  000000791f686444  pst 0000000000000000
[2025-01-07 23:23:30.244802] [STDOUT] stdout: [        ] 20 total frames

@jtmcdole jtmcdole added the revert Autorevert PR (with "Reason for revert:" comment) label Jan 8, 2025
auto-submit bot pushed a commit that referenced this pull request Jan 8, 2025
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 8, 2025
#161318)

<!-- start_original_pr_link -->
Reverts: #161273
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jtmcdole
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: tree broken:

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8726329921123044593/+/u/run_new_gallery_opengles_impeller__transition_perf/stdout

```
[2025-01-07 23:23:30.242453] [STDOUT] stdout: [        ] signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
[2025-01-07 23:23:30.242492] [STDOUT] stdout: [        ] Abort message: '[FATAL:flutter/impeller/renderer/backen
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jonahwilliams
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {jtmcdole}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Part of #161209

Many Adreno 6XX are having trouble compiling the PorterDuff and ConicalGradient Pipeline. This rewrites the former to use specialization constants to reduce runtime branches. From testing on an S9+, this is sufficient to get it to compile correctly.

As a bonus, this should be faster... though it adds more shaders.

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
Co-authored-by: John McDole <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 10, 2025
srujzs pushed a commit to srujzs/flutter that referenced this pull request Jan 12, 2025
Part of flutter#161209

Many Adreno 6XX are having trouble compiling the PorterDuff and
ConicalGradient Pipeline. This rewrites the former to use specialization
constants to reduce runtime branches. From testing on an S9+, this is
sufficient to get it to compile correctly.

As a bonus, this should be faster... though it adds more shaders.
srujzs pushed a commit to srujzs/flutter that referenced this pull request Jan 12, 2025
…161273)" (flutter#161318)

<!-- start_original_pr_link -->
Reverts: flutter#161273
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jtmcdole
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: tree broken:

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8726329921123044593/+/u/run_new_gallery_opengles_impeller__transition_perf/stdout

```
[2025-01-07 23:23:30.242453] [STDOUT] stdout: [        ] signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
[2025-01-07 23:23:30.242492] [STDOUT] stdout: [        ] Abort message: '[FATAL:flutter/impeller/renderer/backen
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jonahwilliams
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {jtmcdole}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Part of flutter#161209

Many Adreno 6XX are having trouble compiling the PorterDuff and ConicalGradient Pipeline. This rewrites the former to use specialization constants to reduce runtime branches. From testing on an S9+, this is sufficient to get it to compile correctly.

As a bonus, this should be faster... though it adds more shaders.

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
Co-authored-by: John McDole <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants