VOGONS

Common searches


First post, by Narzoul

User metadata
Rank Newbie
Rank
Newbie

I've recently upgraded to an Alder Lake CPU with an integrated GPU (UHD 770). While I was testing whether it works with DDrawCompat (it doesn't without changes, sadly), I noticed some interesting things.

First, it's not loading the usual igdumdim32.dll user-mode display driver, instead it's loading d3d9on12.dll. While debugging how this happens, I found that the call to D3DKMTQueryAdapterInfo with Type=KMTQAITYPE_UMDRIVERNAME (which is supposed to return a path to the user-mode display driver) fails with STATUS_INVALID_PARAMETER (0xC000000D). After this, the DirectDraw runtime seems to automatically fall back to loading d3d9on12.dll instead.

I looked at the inf file of the Intel driver and it seems like this would be the case for all Alder Lake S iGPUs. The installer intentionally doesn't register any D3D9 driver (even though it does still install the igdumdim32/64.dlls).

Well, that's interesting in itself, but more to the point: I'm fairly sure this could be (ab)used to load D3D9On12 in any DX 1-9 game with a very simple wrapper that hooks D3DKMTQueryAdapterInfo to reproduce the above error code for the driver path query. I tried this briefly with DDrawCompat and it worked for both AMD and NVIDIA drivers - at least in windowed mode. Exclusive full-screen mode needs more work specifically in DDrawCompat, because D3D9On12 doesn't seem to support that. It doesn't work with the DXPrimaryEmulation -DisableMaxWindowedMode shim either when using the Intel iGPU without a wrapper.

There is also a compatibility shim that can do the same already for D3D9 at least (I don't think the shim works with anything older): D3D9On12Enabler -On (the "-On" parameter is important).
I tested it very briefly with the Black & White 2 demo and it seemed to work fine. It definitely loaded d3d9on12.dll and not my usual AMD D3D9 drivers.

I wonder if this could be used to fix some compatibility issues, especially driver related ones, like the NVIDIA color key bugs, blt mirroring issues, etc.
I might put together some wrappers for this when I have some more time. Of course, this would only work on Windows 10/11.

Reply 1 of 11, by mrpenguinb

User metadata
Rank Newbie
Rank
Newbie

Does this mean that DX1-9 games can be run with minimal issues if D3D9on12 dll is used? Could it make DX1-9 games work without requiring a wrapper like dgVoodoo2?
I'm not sure if I'm understanding this correctly.
If this works around driver incompatibilities with NVIDIA/AMD and Intel, it could become essential for some people.

Last edited by mrpenguinb on 2022-03-25, 04:20. Edited 1 time in total.

Reply 2 of 11, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie

The implementation looks neat to me, although I always ignored it. It reminds me of dgVoodoo2 MS WARP (which is d3d11 iirc) , which fixed difficult cases, and now probably D3D9on12 may probably improve situations, at least for less compatible games. NVIDIA color key bug, is one that I am more inclined to see get fixed.

previously known as Discrete_BOB_058

Reply 3 of 11, by Narzoul

User metadata
Rank Newbie
Rank
Newbie

Here we go: https://github.com/narzoul/ForceD3D9On12

Don't get your hopes up. Most games using ddraw.dll crash, at least the 3D ones. But a few work fine, Unreal for example. D3D8/9 seems to have better compatibility, but I didn't have much time to test a lot of titles.

Reply 4 of 11, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie
Narzoul wrote on 2022-03-20, 00:16:

Here we go: https://github.com/narzoul/ForceD3D9On12

Don't get your hopes up. Most games using ddraw.dll crash, at least the 3D ones. But a few work fine, Unreal for example. D3D8/9 seems to have better compatibility, but I didn't have much time to test a lot of titles.

Got a game that works, albeit with glitches. Game's MechWarrior 2 Titanium Edition. I created a new issue...

previously known as Discrete_BOB_058

Reply 5 of 11, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie
Narzoul wrote on 2022-03-20, 00:16:

Here we go: https://github.com/narzoul/ForceD3D9On12

Don't get your hopes up. Most games using ddraw.dll crash, at least the 3D ones. But a few work fine, Unreal for example. D3D8/9 seems to have better compatibility, but I didn't have much time to test a lot of titles.

Rainbow Six Software Rendered version runs fine, I didn't encounter issues. Note that I had to run it through DxWnd, that is I required both DxWnd and your wrapper. HW rendered version crashes while creating mission

previously known as Discrete_BOB_058

Reply 6 of 11, by robertmo

User metadata
Rank l33t++
Rank
l33t++
Narzoul wrote on 2022-03-20, 00:16:

Here we go: https://github.com/narzoul/ForceD3D9On12

Don't get your hopes up. Most games using ddraw.dll crash, at least the 3D ones. But a few work fine, Unreal for example. D3D8/9 seems to have better compatibility, but I didn't have much time to test a lot of titles.

any advantage of these over a dgvoodoo2?

Reply 7 of 11, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie
robertmo wrote on 2022-08-18, 05:17:
Narzoul wrote on 2022-03-20, 00:16:

Here we go: https://github.com/narzoul/ForceD3D9On12

Don't get your hopes up. Most games using ddraw.dll crash, at least the 3D ones. But a few work fine, Unreal for example. D3D8/9 seems to have better compatibility, but I didn't have much time to test a lot of titles.

any advantage of these over a dgvoodoo2?

Maybe not now, but Narzoul may consider supporting things that dgVoodoo2 didn't

previously known as Discrete_BOB_058

Reply 8 of 11, by mirh

User metadata
Rank Member
Rank
Member

OP is in no way responsible for the graphical capabilities of D3D9On12. His library is just a hundred lines of code to force that.
I guess an advantage is that it's all open source? Somewhat like dxup, except this is actually still getting developed.

I cannot vouch for features then, but at least performance is still lagging behind in my testing on a single scene of mass effect.
(please be mindful, results are highly dependent on GPU architecture and the kind of bottleneck you were actually experiencing)
This: 130
D3D9: 200
DGV2: somewhere in-between
DXVK: 260

By the way, if it wasn't for this fps difference I could hardly be sure the thing is engaged like at all.
Sure I can see in process monitor that d3d9on12.dll is being loaded, and that somehow the nvidia driver is using nvwgf2um.dll in place of the normal nvd3dum.dll..
But Rivatuner will still display D3D9 is being used (unlike the other wrappers).

pcgamingwiki.com

Reply 9 of 11, by Squall Leonhart

User metadata
Rank Newbie
Rank
Newbie
mirh wrote on 2022-08-31, 13:15:
OP is in no way responsible for the graphical capabilities of D3D9On12. His library is just a hundred lines of code to force tha […]
Show full quote

OP is in no way responsible for the graphical capabilities of D3D9On12. His library is just a hundred lines of code to force that.
I guess an advantage is that it's all open source? Somewhat like dxup, except this is actually still getting developed.

I cannot vouch for features then, but at least performance is still lagging behind in my testing on a single scene of mass effect.
(please be mindful, results are highly dependent on GPU architecture and the kind of bottleneck you were actually experiencing)
This: 130
D3D9: 200
DGV2: somewhere in-between
DXVK: 260

By the way, if it wasn't for this fps difference I could hardly be sure the thing is engaged like at all.
Sure I can see in process monitor that d3d9on12.dll is being loaded, and that somehow the nvidia driver is using nvwgf2um.dll in place of the normal nvd3dum.dll..
But Rivatuner will still display D3D9 is being used (unlike the other wrappers).

9on12 is opensource, if there are improvements to be had, make them.

Reply 10 of 11, by Squall Leonhart

User metadata
Rank Newbie
Rank
Newbie

Microsoft have introduced a change to the 9on12 code that should resolve performance issues going forward, they were storing certain buffers in system memory instead of VRAM.

https://github.com/microsoft/D3D9On12/commit/ … c76d3b132685e24

Reply 11 of 11, by mirh

User metadata
Rank Member
Rank
Member

Cool, though for the time being you'd have to compile it yourself to try.
Microsoft really takes it easy to ship updates, and even with the latest patched W10 22H2 (not sure if insider on W11 couldn't be luckier?) I'm still stuck to several-months-old 10.0.19041.2193 d3d9on12.dll.

pcgamingwiki.com