Repository navigation
Conversation
…-debug test builds
…-kov/flutter into impeller-backdrop-no-msaa-2
…-kov/flutter into impeller-backdrop-no-msaa-2
|
@gaaclarke can you add cicd again? i fixed test problem that appeared only in release builds, which i ran with host_debug_unopt_x64 locally before and did not notice that impeller::Command |
gaaclarke
left a comment
There was a problem hiding this comment.
The code looks good, the test is very flimsy though. I'll see if I can come up with a better alternative.
it was very difficult to make it without linux machine, and metal encoded commands without keeping the list. Test also depended on this pr #193189 that was reverted and needs adjustments |
|
@krll-kov I pushed a more robust test. I think this was the easiest way to test exactly what we want. It required a lot of plumbing, but that's the sort of thing an LLM is good at hooking up. Alternatively we could have tried to mock things at a higher level than opengles and it would have been cross-backend, but we don't have an existing example of that and it would have taken a lot of code to setup. This it's an integration test with a few other things too. |
|
@krll-kov do you mind if I fork this PR into one that I created so it's not a "draft"? It should still attribute you as a collaborator since I'll move your commit over. I don't have the ability to remove the "draft" status from this PR. I've complained to the people that have that power and I've been promised the process will be improved. |
It's even better since fix would land faster! |
|
closed in lieu of #193306 |
…d framebufferfetch (flutter#193306) My fork of flutter#193178 to avoid OP's open PR limit. Coauthored with @krll-kov Fixes flutter#192918 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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 in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [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]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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 [flutter/website]: https://github.com/flutter/website [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 --------- Co-authored-by: Kyrylo K. <63228361+krll-kov@users.noreply.github.com>
…d framebufferfetch (flutter#193306) My fork of flutter#193178 to avoid OP's open PR limit. Coauthored with @krll-kov Fixes flutter#192918 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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 in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [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]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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 [flutter/website]: https://github.com/flutter/website [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 --------- Co-authored-by: Kyrylo K. <63228361+krll-kov@users.noreply.github.com>
…d framebufferfetch (flutter#193306) My fork of flutter#193178 to avoid OP's open PR limit. Coauthored with @krll-kov Fixes flutter#192918 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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 in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [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]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **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 [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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 [flutter/website]: https://github.com/flutter/website [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 --------- Co-authored-by: Kyrylo K. <63228361+krll-kov@users.noreply.github.com>

Fixes #192918
When a device has no offscreen MSAA, the pass target has no resolve texture, so every pass after the first one loads and writes the same texture the backdrop is read from.
FlipBackdropthen draws that texture into itself. D3D11 cannot bind it as a shader resource and a render target at the same time, so ANGLE unbinds the shader resource and the draw samples zeros. Everything drawn before the firstBackdropFilteror advanced blend disappears from the frame.Change
That draw is only needed when the pass writes to a different texture than the one the backdrop is read from, so it is skipped when they are the same texture.
Gemini's proposal in issue used a new
DidLoadPreviousContents()flag for this. I compare the color attachment withinput_textureinstead. The flag says that the pass loaded its previous contents, not which texture it writes to. Those are the same thing only while the pass target is never swapped, and the groupedBackdropFiltercase, which is described in same issue, swaps it to a second texture. With the flag alone the draw would then be skipped although it is needed, and the backdrop would be missing from the frame, silently in profile and release builds. TheDCHECKkeeps the invariant: a pass that writes into the backdrop texture must have loaded it.Testing
BackdropFlipWithoutOffscreenMSAASkipsSelfDrawmocks a device with no offscreen MSAA and no framebuffer fetch, records an advanced blend and checks that the pass holds noMSAA backdropdraw. It runs on the GLES backend, because that is the backend that keeps the recorded commands. I tried Metal first, but it encodes the commands right away and keeps no list. For that the GLES playground needed the capability override that Metal already has, so this PR implementsContextGLES::SetCapabilitiesandPlaygroundImplGLES::SetCapabilities, which returnedkUnimplementedbefore.On a Radeon 890M new test fails on both GLES parameters without the fix, with one
MSAA backdropdraw recorded, and passes with it.I also ran 15 scenes with
BackdropFilter,BackdropGroupand advanced blends on Windows at feature level 10_0. Without the fix 14 of them differ from the reference frame by 2.2 to 3.5 million pixels. With the fix 11 match the reference exactly. Two more differ only in antialiasing, since the reference has MSAA and feature level 10_0 does not. The last two are groupedBackdropFilters with different filters, which this change renders the way Skia does, not as normally working impeller when offscreen MSAA is available.Pre-launch Checklist
///).