bo3b / 3Dmigoto

Chiri's DX11 wrapper to enable fixing broken stereoscopic effects.
Other
688 stars 109 forks source link

Possible to run 3Dmigoto in Elite Dangerous with OpenXR Toolkit? #183

Open Houndmux opened 8 months ago

Houndmux commented 8 months ago

When I try to run 3Dmigoto with OpenXR Toolkit in Elite Dangerous, I get the error message:

The procedure entry point D3D11On12CreateDevice could not be located in the dynamic link library C:\Program Files\OpenXR-Toolkit\XR_APILAYER_MBUCCHIA_toolkit.dll

and then:

OpenXR Call failed, aborting. C:\projects\openovr\DrvOpenXR\DrvOpenXR.cpp:201 CreateOpenXRBackend. Error code: -32 xrCreateInstance(&creatInfo, &xr_instance)

(note: I don't have a C:\projects folder)

Is there a way to fix this?

DarkStarSword commented 7 months ago

D3D11On12CreateDevice

This indicates that DirectX 12 is in use with a DX11 compatibility layer (11on12) enabled, but 3DMigoto is a DirectX 11 modding tool only, so even with the compatibility layer this isn't a situation that we would necessarily expect to work.

That said, 3DMigoto does work fine with Elite Dangerous (Cockpit Paint Mod and Elite Dangerous Hud Mod both use 3DMigoto, as do several other ED mods, and it is known to work in Steam VR and Oculus VR as well), as it is natively a DX11 title, so I presume the use of DX12 must be coming from OpenXR or some other injected tool which is having some sort of compatibility issue with 3DMigoto.

(note: I don't have a C:\projects folder)

That path is on the developer's computer who compiled OpenXR, not your PC.

Can you please provide more info about your setup, particularly which VR headset you are using, and which OpenXR runtime you are using (if using SteamVR open settings -> enable advanced settings -> Developer -> Current OpenXR Runtime. If using something else google how to find this)?

DarkStarSword commented 7 months ago

This is a bit of a stab in the dark, but you might be able to kludge it into working by forcing 3DMigoto to use hooking rather than wrapping:

I would try the first suggestion by itself, then if that doesn't work try them both together. Note that all this kludge all hinges on something calling D3D11CreateDevice[AndSwapChain] at some point - if that never happens when 11on12 is in use this may not work.

Houndmux commented 7 months ago

Thanks, option 1 worked! (Pimax 8KX with PimaxXR runtime)

bo3b commented 3 days ago

I"m reopening this bug because a recent version of Unity 2023 has the same problem.

In the game Planet Crafter, 3Dmigoto will block launch because we don't export the D3D11On12CreateDevice call. I can also load 3Dmigoto using the hooking approach.

However, this seems like an oversight for us, and does not match our goal of having a seemless drop in d3d11.dll loader. Times have changed, and Microsoft is exporting more functions in the .def. We should go ahead and update to include all current APIs that are exported with call-throughs for stuff we don't know about, or don't care about.

I'm not quite sure how this should connect to the current D3D11On12CreateDevice handling.

Another open question is that if we crack open this part, we probably should consider adding dxgi exports as well, and use the Reshade approach of exporting everything so that people can simply rename the dll to get different load techniques.