diff --git a/src/d3d8/d3d8_device.cpp b/src/d3d8/d3d8_device.cpp index b2651b0f7234..c48413ffa0e5 100644 --- a/src/d3d8/d3d8_device.cpp +++ b/src/d3d8/d3d8_device.cpp @@ -282,6 +282,10 @@ namespace dxvk { IDirect3DTexture8** ppTexture) { InitReturnPtr(ppTexture); + // Nvidia & Intel workaround for The Lord of the Rings: The Fellowship of the Ring + if (m_d3d8Options.placeP8InScratch && Format == D3DFMT_P8) + Pool = D3DPOOL_SCRATCH; + Com pTex9 = nullptr; HRESULT res = GetD3D9()->CreateTexture( Width, diff --git a/src/d3d8/d3d8_options.h b/src/d3d8/d3d8_options.h index c2c454348f90..9b4b79c33a3c 100644 --- a/src/d3d8/d3d8_options.h +++ b/src/d3d8/d3d8_options.h @@ -28,12 +28,26 @@ namespace dxvk { /// May hurt performance outside of specifc games that benefit from it. bool batching = false; + /// 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. + /// + /// Early Nvidia GPUs, such as the GeForce 4 generation cards, included and exposed + /// P8 texture support. However, it was no longer advertised with cards in the FX series + /// and above. Most likely ATI/AMD drivers never supported P8 in the first place. + bool placeP8InScratch = false; + D3D8Options() {} D3D8Options(const Config& config) { int32_t minManagedSize = config.getOption ("d3d8.managedBufferPlacement", managedBufferPlacement); managedBufferPlacement = config.getOption ("d3d8.managedBufferPlacement", true) ? minManagedSize : UINT32_MAX; - auto forceVsDeclStr = config.getOption("d3d8.forceVsDecl", ""); + auto forceVsDeclStr = config.getOption("d3d8.forceVsDecl", ""); batching = config.getOption ("d3d8.batching", batching); + placeP8InScratch = config.getOption ("d3d8.placeP8InScratch", placeP8InScratch); parseVsDecl(forceVsDeclStr); } diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index dc7d141ad8eb..d22265afb569 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -1111,6 +1111,12 @@ namespace dxvk { { R"(\\(nations|patriots)\.exe$)", {{ { "d3d8.managedBufferPlacement", "False" }, }} }, + /* The Lord of the Rings: * + * The Fellowship of the Ring */ + { R"(\\Fellowship\.exe$)", {{ + { "d3d9.maxFrameRate", "60" }, + { "d3d8.placeP8InScratch", "True" }, + }} }, }};