engine icon indicating copy to clipboard operation
engine copied to clipboard

[Impeller] skip mip generation if blur downsample is factor is 0.5 or greater

Open jonahwilliams opened this issue 1 year ago • 4 comments

THe downsample uses bilinear filtering to read from the input texture. To avoid dropping data, we generate mipmaps. However if the downscale factor is 0.5 or 1.0, then we don't need to read from any of the mip levels besides the base. Skip mip generation in this case, since its very expensive.

Additionally, mip generation is moved into the blur, rather than checking for mips and erroring - we generate mips if needed - removing an error condition.

jonahwilliams avatar Jun 28 '24 16:06 jonahwilliams

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

flutter-dashboard[bot] avatar Jun 28 '24 16:06 flutter-dashboard[bot]

It looks like this causes a validation failure on metal, even if we won't end up reading from a higher mip level. Potentially more fuel for separating out bdfs and image filter blurs, since at least in the later case we can compute exactly how many mip levels (if any) we need.

jonahwilliams avatar Jun 28 '24 19:06 jonahwilliams

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

flutter-dashboard[bot] avatar Jun 28 '24 19:06 flutter-dashboard[bot]

Tests did hit this, hence the failure and my comment :)

jonahwilliams avatar Jun 28 '24 20:06 jonahwilliams

Closing in favor of https://github.com/flutter/engine/pull/53760

jonahwilliams avatar Jul 08 '24 22:07 jonahwilliams