Skip to content

Work around Huawei Maleoon Vulkan driver rendering bugs - #315

Open
ihakand wants to merge 1 commit into
encounter:mainfrom
ihakand:fix/maleoon-driver-workarounds
Open

ihakand wants to merge 1 commit into
encounter:mainfrom
ihakand:fix/maleoon-driver-workarounds

Conversation

@ihakand

@ihakand ihakand commented Nov 8, 2026

Copy link
Copy Markdown

Problem

On devices with a Huawei Maleoon GPU (Kirin SoCs), Dusklight shows:

  • a black or speckled box over the top-left quarter of the screen, which flickers during dialogue and other scenes that use depth of field;
  • black speckled blocks on water refraction, particles (walking dust, splashes) and the sun.

Reported in TwilitRealm/dusklight#954 (and the duplicate TwilitRealm/dusklight#1616).

Cause

Two separate driver bugs, narrowed down by toggling individual copy paths and texture usages at runtime on a device:

  1. A small render pass encoded between EFB passes corrupts the top-left of the EFB, with an area matching the small pass's size. The half-size EFB copies (depth of field) are the main trigger. This is independent of what the pass samples or clears to, and an empty pass in between does not help. Doing the same copy in a compute pass avoids it.
  2. Compressed render targets get corrupted by some draws (water refraction "invisible" lists, particles). Giving the EFB textures StorageBinding usage, which keeps the driver from compressing them, avoids it.

Fix

Gated on the adapter name containing Maleoon (webgpu::g_maleoonWorkarounds):

  • tex_copy_conv: compute variants of the blit and all color/depth conversion copies. The existing fragment bodies are reused as functions, so the conversion math is shared with the render-pass path.
  • encoding.cpp: EFB copies that need scaling or conversion use the compute path when it's supported (RGBA8 destination with storage usage).
  • texture.cpp: copy/conversion destination textures get StorageBinding (RGBA8 only).
  • gpu.cpp: the two EFB render textures get StorageBinding; adapter detection.

Other adapters keep the existing render-pass path and texture usages.

Testing

Huawei MatePad Pro 2025 (Maleoon 920, driver B265 1010.279.708), Vulkan, 2800×1840:

  • Top-left box: gone on the prelaunch screen, title screen and during dialogue (depth of field on).
  • Water, Epona's splashes, walking dust, sun: no more black blocks with water refraction on.
  • Performance: making all render textures uncompressed caused a clear frame-rate drop, so it's limited to the two EFB textures. With that, frame rate looked normal in most scenes, but I haven't done an exact before/after comparison against an unpatched build yet.

Not tested on other Maleoon GPUs or driver versions.

Huawei Maleoon GPUs (Kirin SoCs, e.g. Maleoon 910/920) show two rendering
bugs on their Vulkan driver:

- Encoding a small render pass between EFB passes (the half-size EFB copies
  used by depth of field, format-converting EFB copies) corrupts the
  top-left region of the EFB. This shows up as a black or speckled box
  covering the top-left quarter of the screen.
- Compressed render targets get corrupted by some draws, which shows up as
  black speckled blocks on water refraction, particles (dust, splashes) and
  the sun glare.

When the adapter name contains "Maleoon":

- EFB copies that need scaling or format conversion (color and depth) are
  encoded as compute passes writing to storage textures instead of render
  passes. The existing per-format conversion shaders are reused as plain
  functions.
- The EFB render textures get StorageBinding usage, which keeps the driver
  from compressing them.

Other adapters are unaffected.
@StilesCrisis

Copy link
Copy Markdown

It's not up to me, but fixing this in Aurora seems misguided. Ideally you fix the driver. If it's closed source, add the workaround in Dawn and see if they'd accept that patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants