yuzu icon indicating copy to clipboard operation
yuzu copied to clipboard

YFC - Fermi2D: Rework blit engine and add a software blitter.

Open FernandoS27 opened this issue 2 years ago • 0 comments

This PR aims to fix the issues with ASTC texture mipmap uploads on many games. This has been a feature I've really wanted to be part of the original YFC release but I struggled long to get it working as I originally intended.

Originally, I was confused by our texture cache and I though games were actually rendering the ASTC mipmaps. It turns out that nope, the mipmaps were being uploaded through Fermi2D engine (since NVIDIA driver implements block linear to block linear texture copy with that). This puzzled me a lot initially but at the end I decided to add a software blitter as fallback when GPU acceleration is unnecessary. It still need tweaking and some features.

This fixes the texture corruption in a bunch of games:

  • Blue Fire.
  • A Hat in Time.
  • The Witcher 3.
  • Darksiders 3.
  • Diablo II Resurrected (character hair).
  • Dragon Quest XI.
  • Life is Strange: True Colors.
  • Yoshi's Crafted World.
  • Fist: Forged in Shadow Torched.
  • likely other UE4 games.
  • Kirby Start Allies: Depth of field.
  • Digimon Story Cyber Sleuth.
  • GTA Trilogy

Also fixes BGR issues in:

  • Turok 2.
  • Doom64
  • Ys IX: Monstrum Nox.

Fixed Nouveau texture to texture copies:

  • Fixes GZDOOM

Pending before merge:

  • [X] Implement Bilinear filtering.
  • [X] Improve performance on big textures.
  • [ ] Clean up the code.
  • [X] Address feedback.

It's still a draft and some work needs to be done.

FernandoS27 avatar Nov 06 '22 02:11 FernandoS27