-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
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.
- Image Rendering error on Redmi K80Pro. #160441
- [Impeller] Rendering glitches on Android Qualcomm Adreno 830 GPU devices #159876
- Image Rendering artifacts on OnePlus 13. #160587
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
- Generate mips on the CPU. This will be slow, and additionally require readback in places that we previously didnt need it. Last choice.
- 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.
- Use a render pass chain to do the downsizing. Less bad than 1.
- 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: