[Impeller] skip mip generation if blur downsample is factor is 0.5 or greater
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.
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.
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.
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.
Tests did hit this, hence the failure and my comment :)
Closing in favor of https://github.com/flutter/engine/pull/53760