AlpyneDreams / d8vk

Direct3D 8 to Vulkan translation for DXVK! Merged into dxvk: https://github.com/doitsujin/dxvk
zlib License
486 stars 6 forks source link

[d3d8] Add a workaround for LotR: Fellowship of the Ring #209

Closed WinterSnowfall closed 2 days ago

WinterSnowfall commented 3 months ago

Fixes #182. I've summed it up in the description for the new config option I added, but this is essentially a game bug that manifests itself even on Windows with Nvidia & Intel:

/// The Lord of the Rings: The Fellowship of the Ring tries to create a P8 texture
/// in D3DPOOL_MANAGED on Nvidia and Intel, which fails, but has a separate code 
/// path for ATI/AMD that creates it in D3DPOOL_SCRATCH instead, which works.
///
/// The internal logic determining this path doesn't seem to be d3d-related, but 
/// the game works universally if we mimic its own ATI/AMD workaround during P8 
/// texture creation.
///
/// There's some indication early Nvidia drivers included P8 texture support,
/// but that it was removed at some point along with the launch of its FX series of
/// cards. Most likely ATI/AMD drivers never supported P8 in the first place.

It's a config option because, as mentioned previously, not even native Nvidia drivers support P8 textures (for a while now, allegedly) and other games might depend on calls to CreateTexture() failing, since we don't actually expose support for P8.

This PR will most likely have conflicts with other PRs I have open, but I can rebase when we start merging them.

WinterSnowfall commented 2 months ago

I've confirmed my assumptions on an age-accurate system, with some corrections: the support for P8 was no longer advertised starting with GeForce FX cards, but it was present in GeForce 4 and earlier cards. The driver version isn't particularly relevant here from what I've observed.