mwOn12 logomwOn12 logo

MWOn12

Most Wanted, rendered through Direct3D 12.

MWOn12 is a d3d9.dll that sits between the game and the graphics driver. The game keeps making Direct3D 9 calls; MWOn12 turns them into Direct3D 12. The game itself is never patched and never knows.

speed.exe
   |   Direct3D 9
   v
MWOn12  (d3d9.dll)
   |   Direct3D 12
   v
DXGI  ->  GPU

Every part of the translation is our own: the Direct3D 9 state model, the shader translator that turns Direct3D 9 bytecode into HLSL, the fixed-function emulator, descriptor allocation, resource barriers and synchronisation. It doesn't use Microsoft's D3D9On12, D3D11On12, DXVK or WineD3D.

You can check that yourself. The DLL imports d3d12.dll, dxgi.dll, D3DCOMPILER_47.dll, kernel32 and user32, and nothing else. It does export Direct3DCreate9On12 so that anything asking for it by name still links, and then ignores the Direct3D 12 device it's handed and uses its own.

Installing it

  1. Copy d3d9.dll and MWOn12.ini into the folder with speed.exe.
  2. Run the game.

Windows looks for a program's DLLs in its own folder first, so the game loads MWOn12 instead of the system's Direct3D 9. To uninstall, delete the two files. MWOn12.log, next to the game, tells you which renderer you got.

Settings

Everything lives in MWOn12.ini and is read once at launch.

[Renderer]
Backend=2               ; 2 = Direct3D 12.  1 = the system d3d9.dll, untouched.
BorderlessFullscreen=1  ; recommended

Backend=1 is a way out for a machine with no Direct3D 12 adapter, not a second renderer. MWOn12 switches to it by itself if the adapter can't do Direct3D 12 feature level 11_0, and says so in the log.

SettingWhat it gives you
VerboseLog=1The full render trace in MWOn12-render.log
DredBreadcrumbs=1On a "device removed" error, the GPU command that faulted
DebugLayer=1Direct3D 12 validation messages in the same log

Multisampling is reported to the game as unavailable, and a request for a multisampled target gets a single-sampled one with a line in the log. That's deliberate: a game told MSAA exists and then handed a single-sampled target has no way to notice.

Mods

MWOn12 is also an ASI loader. Drop a .asi into scripts\ and it runs, loaded on the first Direct3DCreate9: after the game's code is in memory, before it draws anything, and outside the loader lock. Plugins in MWOn12\Plugins\ get the live Direct3D 12 device every frame. Both are covered by the MWOn12 SDK, and so is the shader kit, which replaces the game's shaders with your own HLSL without any code.

Building it

Build.bat

Visual Studio 2022 with the C++ workload and nothing else: no DirectX SDK, no package manager, no network access. The output is build_win32\Release\d3d9.dll. The build is x86 only, because speed.exe is a 32-bit program and a 64-bit DLL could never load into it.