Skip to content

[Impeller] re-enable runtime mipmap generation on Adreno GPU. #161283

@jonahwilliams

Description

@jonahwilliams

Based on a large number of issue reports and my own testing, generating mipmaps on Adreno GPU can occassionally corrupt the image - though this depends on the exact dimensions and number of mips. This can happen on 6XX, 7XX, and 8XX series.

The strategy we use is essentially the same as https://docs.vulkan.org/samples/latest/samples/api/texture_mipmap_generation/README.html (and even then, I replaced our code with a copy paste of that one and still reproduced the same problems). I am also fairly certain that it is not a synchronization problem, as I've tested with "everything" barrier between blits and can still reproduce the problems.

My current best guess is a bug in the driver. We have a few options to work around it

  1. Generate mips on the CPU. This will be slow, and additionally require readback in places that we previously didnt need it. Last choice.
  2. Test and determine if there are magic numbers that work consistently. Surely the driver can't be that broken right? Maybe with a square power of two texture we can guarantee no corruption. Then we could blit regions onto a correctly sized texture.
  3. Use a render pass chain to do the downsizing. Less bad than 1.
  4. Use a compute pass to do the downsizing. If this is how well blit passes work on adreno I don't even want to touch compute lmao.

I'm going to try a bit of 2. and then probably do 3. But not until higher priority issues are solved.

Potentially related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions