-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Impeller] porter duff workarounds for Adreno GPU. #161273
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] porter duff workarounds for Adreno GPU. #161273
Conversation
|
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. |
matanlurey
left a comment
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.
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
}};
}|
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 Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| 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) + |
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.
nit; but just a nice documentation trail:
// see GetPorterDuffSpecConstants for actual constants
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.
Done
|
yay goldens work! |
|
Reason for revert: tree broken: |
This reverts commit b5df290.
#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]>
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.
…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]>
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.