3Dmigoto
3Dmigoto copied to clipboard
BUG: Unwrapped ID3D11Device! (Linux/WINE)
I tried to play genshin impact with 3DMigoto-GIMI, the game crashed and it looks like might be a 3DMigoto bug. Also im playing on Linux with wine. The content of created log called d3d11_log.txt might be helpful:
D3D11 DLL starting init - v 1.3.16 - Sat Oct 14 22:46:00 2023
Game path: Z:\home\user\Games\Heroic\GenshinImpact\Genshin Impact game\GenshinImpact.exe 3DMigoto path: Z:\home\user\Downloads\3dmigoto\3dmigoto.dll
----------- d3dx.ini settings ----------- [Logging] calls=1 input=1 debug=0 unbuffered=0 force_cpu_affinity=0 crash=0 debug_locks=0 [Include] include_recursive=Mods Searching "Z:\home\user\Downloads\3dmigoto\Mods*" Searching "Z:\home\user\Downloads\3dmigoto\Mods\BufferValues*" Processing "Z:\home\user\Downloads\3dmigoto\Mods\BufferValues\HealthBar.ini" namespace=global\HealthBar Renaming namespace "Mods\BufferValues\HealthBar.ini" -> "global\HealthBar" Searching "Z:\home\user\Downloads\3dmigoto\Mods\GanyuMod*" Processing "Z:\home\user\Downloads\3dmigoto\Mods\GanyuMod\Ganyu.ini" exclude_recursive=DISABLED* include=ShaderFixes\help.ini [System] load_library_redirect=2 allow_check_interface=1 allow_create_device=1 allow_platform_update=1 check_foreground_window=1 [Device] upscaling=0 full_screen=0 force_stereo=0 get_resolution_from=swap_chain hide_cursor=0 [Stereo] automatic_mode=0 create_profile=0 force_no_nvapi=0 [Rendering] shader_hash=3dmigoto override_directory=ShaderFixes cache_directory=ShaderCache cache_shaders=0 rasterizer_disable_scissor=0 assemble_signature_comments=1 disassemble_undecipherable_custom_data=1 patch_assembly_cb_offsets=1 recursive_include=1 export_fixed=0 export_shaders=0 export_hlsl=0 dump_usage=1 stereo_params=125 ini_params=120 fix_sv_position=0 [Hunting] hunting=2 reload_config=no_modifiers VK_F10 wipe_user_config=ctrl alt no_shift VK_F10 monitor_performance=ctrl no_shift no_alt F9 freeze_performance_monitor=no_ctrl shift no_alt F9 monitor_performance_interval=2.000000 take_screenshot=no_modifiers VK_SNAPSHOT toggle_hunting=no_modifiers NO_VK_DECIMAL VK_NUMPAD0 repeat_rate=6 marking_mode=skip next_marking_mode=no_modifiers VK_DECIMAL VK_NUMPAD0 marking_actions=hlsl asm clipboard regex stereo_snapshot snapshot_if_pink next_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD2 previous_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD1 mark_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD3 next_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_MULTIPLY previous_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_DIVIDE mark_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_SUBTRACT next_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD8 previous_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD7 mark_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD9 next_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD5 previous_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD4 mark_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD6 next_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD2 previous_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD1 mark_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD3 next_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD5 previous_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD4 mark_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD6 next_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD8 previous_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD7 mark_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD9 next_hullshader=no_modifiers VK_DECIMAL VK_MULTIPLY previous_hullshader=no_modifiers VK_DECIMAL VK_DIVIDE mark_hullshader=no_modifiers VK_DECIMAL VK_SUBTRACT done_hunting=NO_MODIFIERS NO_VK_DECIMAL VK_ADD reload_fixes=no_modifiers VK_F10 show_original=no_modifiers VK_F9 analyse_frame=no_modifiers VK_F8 analyse_options=dump_rt dump_tex dump_cb dump_vb dump_ib buf txt verbose_overlay=1 [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBlend] filename=GanyuBlend.buf type=Buffer stride=32 [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBodyDiffuse] filename=GanyuBodyDiffuse.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBodyIB] filename=GanyuBody.ib type=Buffer format=R32_UINT [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBodyLightMap] filename=GanyuBodyLightMap.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBodyMetalMap] filename=GanyuBodyMetalMap.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuBodyShadowRamp] filename=GanyuBodyShadowRamp.jpg [Resource\Mods\GanyuMod\Ganyu.ini\GanyuDressDiffuse] filename=GanyuDressDiffuse.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuDressIB] filename=GanyuDress.ib type=Buffer format=R32_UINT [Resource\Mods\GanyuMod\Ganyu.ini\GanyuDressLightMap] filename=GanyuDressLightMap.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuDressMetalMap] filename=GanyuDressMetalMap.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuDressShadowRamp] filename=GanyuDressShadowRamp.jpg [Resource\Mods\GanyuMod\Ganyu.ini\GanyuFaceHeadDiffuse] filename=GanyuFaceHeadDiffuse.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuHeadDiffuse] filename=GanyuHeadDiffuse.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuHeadIB] filename=GanyuHead.ib type=Buffer format=R32_UINT [Resource\Mods\GanyuMod\Ganyu.ini\GanyuHeadLightMap] filename=GanyuHeadLightMap.dds [Resource\Mods\GanyuMod\Ganyu.ini\GanyuHeadShadowRamp] filename=GanyuHeadShadowRamp.jpg [Resource\Mods\GanyuMod\Ganyu.ini\GanyuPosition] filename=GanyuPosition.buf type=Buffer stride=40 [Resource\Mods\GanyuMod\Ganyu.ini\GanyuTexcoord] filename=GanyuTexcoord.buf type=Buffer stride=20 [Resource\ShaderFixes\help.ini\Font] filename=LiberationSans-Bold.dds [Resource\ShaderFixes\help.ini\Help] [Resource\ShaderFixes\help.ini\HelpCS2GS] type=StructuredBuffer array=4096 stride=16 [Resource\ShaderFixes\help.ini\HelpFull] filename=help.txt type=buffer format=R8_UINT [Resource\ShaderFixes\help.ini\HelpShort] filename=help_short.txt type=buffer format=R8_UINT [Resource\ShaderFixes\help.ini\Notification] [Resource\ShaderFixes\help.ini\NotificationCS2GS] type=StructuredBuffer array=4096 stride=16 [Resource\ShaderFixes\help.ini\NotificationParams] type=StructuredBuffer array=1 data=R32_FLOAT -1.00 -1.0 +1 -1.0 0.25 1 0.25 1 0 0 0 0.75 0.00 0.00 1 3 0 1.0 [Resource\ShaderFixes\help.ini\Params] [Resource\ShaderFixes\help.ini\ParamsFull] type=StructuredBuffer array=1 data=R32_FLOAT -0.8 0.9 0.8 -1 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 1 0 1.0 [Resource\ShaderFixes\help.ini\ParamsShort] type=StructuredBuffer array=1 data=R32_FLOAT -0.93 -0.9 +1 -0.9 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 3 1 1.0 [Constants] global $costume_mods=1.000000 global $version=7.000000 global $\global\healthbar\health=-1.000000 global $\global\healthbar\hpbarcount=0.000000 global $\global\healthbar\total=100.000000 global $\global\healthbar\ispartyswaploadbar=0.000000 global $\global\healthbar\auxt=0.000000 global $\global\healthbar\hpactive=0.000000 global $\shaderfixes\help.ini\last_window_width global $\shaderfixes\help.ini\last_window_height global $\shaderfixes\help.ini\notification_timeout resourcehelp = ref resourcehelpshort resourceparams = ref resourceparamsshort [Key\ShaderFixes\help.ini\Help] type=toggle run=CommandListHelp Key=no_modifiers F1 [KeyToggleMods] type=cycle Cycle 1: $costume_mods=0 Cycle 2: $costume_mods=1 Key=no_modifiers F6 [builtincustomshaderdisablescissorclipping] scissor_enable=0 rasterizer_state_merge=1 draw = from_caller handling = skip [customshader\shaderfixes\help.ini\rendertext] vs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- gs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- ps=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- [builtincustomshaderenablescissorclipping] scissor_enable=1 rasterizer_state_merge=1 draw = from_caller handling = skip [customshader\shaderfixes\help.ini\formattext] cs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- [builtincommandlistunbindallrendertargets] o0 = null o1 = null o2 = null o3 = null o4 = null o5 = null o6 = null o7 = null od = null [commandlist\shaderfixes\help.ini\help] pre resourcehelp = ref resourcehelpfull pre resourceparams = ref resourceparamsfull pre run = customshaderformattext pre resourcehelpshort = null post resourcehelp = null [commandlistskin] if $costume_mods checktextureoverride = ps-t0 checktextureoverride = ps-t1 checktextureoverride = ps-t2 checktextureoverride = ps-t3 checktextureoverride = vb0 checktextureoverride = vb1 checktextureoverride = vb2 checktextureoverride = ib x140 = 0 endif [commandlistunbindallrendertargets] run = builtincommandlistunbindallrendertargets [ShaderOverride\global\HealthBar\GroundHealthPS] Hash=000d2ce199e12697 allow_duplicate_hash=overrule if $hpactive && ps-t0 == 34 && $ispartyswaploadbar == 1 $hpbarcount = $hpbarcount+1 if $hpbarcount == $total && $auxt%15 == 0 store = $health, ps-cb0, 33 endif endif [ShaderOverride\global\HealthBar\Map] Hash=df48ebf15d4e5d80 $ispartyswaploadbar=1 [ShaderOverrideCharacter] Hash=653c63ba4a73ca8b run = commandlistskin [ShaderRegexEnableTextureOverrides] shader_model=vs_4_0 vs_4_1 vs_5_0 vs_5_1 run = commandlistskin ShaderRegex hash: 441e075f [TextureOverride\global\HealthBar\Icons] Hash=00000000ef054414 filter_index=34.000000 [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuBlend] Hash=000000006f47a39d vb1 = resourceganyublend handling = skip draw = 26448,0 [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuBody] Hash=000000002da186bc match_first_index=12822 ib = resourceganyubodyib ps-t0 = resourceganyubodydiffuse ps-t1 = resourceganyubodylightmap ps-t2 = resourceganyubodymetalmap ps-t3 = resourceganyubodyshadowramp [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuDress] Hash=000000002da186bc match_first_index=47160 ib = resourceganyudressib ps-t0 = resourceganyudressdiffuse ps-t1 = resourceganyudresslightmap ps-t2 = resourceganyudressmetalmap ps-t3 = resourceganyudressshadowramp [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuFaceHeadDiffuse] Hash=00000000b2657593 ps-t0 = resourceganyufaceheaddiffuse [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuHead] Hash=000000002da186bc match_first_index=0 ib = resourceganyuheadib ps-t0 = resourceganyuheaddiffuse ps-t1 = resourceganyuheadlightmap ps-t2 = resourceganyuheadshadowramp [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuIB] Hash=000000002da186bc handling = skip drawindexed = auto [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuPosition] Hash=00000000a5169f1d vb0 = resourceganyuposition [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuTexcoord] Hash=00000000cf27251f vb1 = resourceganyutexcoord [TextureOverride\Mods\GanyuMod\Ganyu.ini\GanyuVertexLimitRaise] Hash=00000000721ca964 [Present] post $auxt=$auxt+1 post $total=$hpbarcount post $hpbarcount=0 post $ispartyswaploadbar=0 post $hpactive=0 local $bak_x = x local $bak_y = y if resourcehelp !== null x = window_width y = window_height if window_width != $last_window_width || window_height != $last_window_height $last_window_width = window_width $last_window_height = window_height run = customshaderformattext endif gs-t112 = resourcehelpcs2gs gs-t113 = resourcehelp gs-t114 = resourceparams ps-t114 = resourceparams run = customshaderrendertext gs-t112 = null gs-t113 = null gs-t114 = null ps-t114 = null if resourcehelpshort !== null && time > 30.0 resourcehelpshort = null resourcehelp = null endif endif if resourcenotification !== null x = window_width y = window_height if window_width != $last_window_width || window_height != $last_window_height $last_window_width = window_width $last_window_height = window_height run = customshaderformattext endif gs-t112 = resourcenotificationcs2gs gs-t113 = resourcenotification gs-t114 = resourcenotificationparams ps-t114 = resourcenotificationparams run = customshaderrendertext gs-t112 = null gs-t113 = null gs-t114 = null ps-t114 = null if time > $notification_timeout resourcenotification = null endif endif x = $bak_x y = $bak_y [ClearRenderTargetView] [ClearDepthStencilView] [ClearUnorderedAccessViewUint] [ClearUnorderedAccessViewFloat] [Profile]
Can't get nvapi handle Replaced Hooked_LoadLibraryExW for: C:\windows\system32\nvapi64.dll to Z:\home\user\Downloads\3dmigoto\nvapi64.dll. Replaced Hooked_LoadLibraryExW fallback for: C:\windows\system32\nvapi64.dll to nvapi64.dll. *** Hooked_CreateDXGIFactory1 called with riid: IDXGIFactory1 Trying to load original_d3d11.dll Hooked_LoadLibraryExW switching to original dll: original_d3d11.dll to C:\windows\system32\d3d11.dll. *** IDXGIFactory creating hook for CreateSwapChain. Successfully installed IDXGIFactory->CreateSwapChain hook. Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 0000000000C83C90 *** IDXGIFactory2 creating hooks for CreateSwapChain variants. Successfully installed IDXGIFactory2->CreateSwapChainForHwnd hook. Successfully installed IDXGIFactory2->CreateSwapChainForCoreWindow hook. Successfully installed IDXGIFactory2->CreateSwapChainForComposition hook. CreateDXGIFactory1 returned factory = 0000000000C83C90, result = 0 NVIDIA driver version 535.99 (branch r535_v0.6.4) Unable to call NvAPI_DRS_SaveSettingsToFileEx NVAPI_ERROR WARNING: Unable to determine which settings are internal - some settings will be garbage
*** D3D11 DLL successfully initialized. ***
Trying to load original_d3d11.dll Hooked_LoadLibraryExW switching to original dll: original_d3d11.dll to C:\windows\system32\d3d11.dll. Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 00000000075C3030 CreateDXGIFactory1 returned factory = 00000000075C3030, result = 0 *** Hooked_CreateDXGIFactory called with riid: IDXGIFactory Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 00000000075F71E0 CreateDXGIFactory returned factory = 00000000075F71E0, result = 0 *** Hooked_CreateDXGIFactory called with riid: IDXGIFactory Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 00000000075F71E0 CreateDXGIFactory returned factory = 00000000075F71E0, result = 0 *** Hooked_CreateDXGIFactory called with riid: IDXGIFactory Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 00000000076492C0 CreateDXGIFactory returned factory = 00000000076492C0, result = 0 *** Hooked_CreateDXGIFactory called with riid: IDXGIFactory Upcast QueryInterface(IDXGIFactory2) returned result = 0, factory = 000000004AB6AFE0 CreateDXGIFactory returned factory = 000000004AB6AFE0, result = 0 *** Hooked IDXGIFactory2::CreateSwapChainForHwnd(00000000075C3030) called Device = 000000000760B138 SwapChain = 000000003F8F3FA8 Description1 = 000000000011F888 FullScreenDescription = 000000000011F870 lookup_hacker_device(000000000760B138) IUnknown: 000000000760B0F0 HackerDevice: 0000000000000000 WARNING: Could not locate HackerDevice for 000000000760B138 Checking what interfaces 000000000760B138 supports... Supports IUnknown: 000000000760B0F0 Supports IDXGIDevice: 000000000760B0F0 Supports IDXGIDevice1: 000000000760B0F0 Supports IDXGIDevice2: 000000000760B0F0 Supports IDXGIObject: 000000000760B0F0 Supports ID3D10Device: 00000000075D49B0 Supports ID3D10Device1: 00000000075D49B0 Supports ID3D10Multithread: 00000000075F7090 (COM identity violation: 00000000075F4180) Supports ID3D11Device: 000000000760B138 Supports ID3D11Device1: 000000000760B138 Supports IDXGIDevice3: 000000000760B0F0 Supports ID3D11Device2: 000000000760B138 Supports IDXGIDevice4: 000000000760B0F0 Supports ID3D11Device3: 000000000760B138 Supports ID3D11Device4: 000000000760B138 Supports ID3D11Multithread: 00000000075F7090 (COM identity violation: 00000000075F4180) Supports ID3D11Device5: 000000000760B138 BUG: Unwrapped ID3D11Device!
Interesting. Firstly, a disclaimer to set some expectations: We don't officially support using 3DMigoto under Linux/WINE, and even if it can be made to load we would never expect the stereoscopic 3D support to work, as that relies on the 3D Vision Automatic component of the Windows NVIDIA driver that was never included in the Linux driver (though this is probably not a concern for Genshin Impact modding specifically, and if it is desired the geo-11 fork of 3DMigoto could be used instead as has its own stereoscopic 3D support that does not rely on NVIDIA).
3DMigoto is pretty closely coupled to how DirectX and Windows operates under the hood (much more so than a normal application) and any deviations of this in WINE / Linux could easily cause issues (and these would be considered WINE bugs, as that is supposed to provide the application an environment nearly indistinguishable from running on Windows). For example, the log file you posted has already pointed out that WINE has a pretty clear bug as the ID3D11Multithread interface it exposes is violating the COM identity rule, which is not the case for that interface on Windows (though I don't expect that specific instance of that bug to cause 3DMigoto any problems, but if the same bug crops up in other situations it very well could). There also appears to be a difference in D3DCompile's error buffer allocation as those BEGIN and END lines shouldn't show up with nothing between them if it properly matched Windows behaviour (probably not going to be an issue for 3DMigoto, but I wonder how many games exhibit memory leaks under WINE thanks to that difference).
TBH back when I used to be a Linux Kernel developer WINE had so many problems with DirectX compatibility that it just wasn't worth the effort most of the time. I'm aware that Valve and CodeWeavers have significantly improved the situation since then, though I'm not sure how much of that is in vanilla WINE, or if you really need to be running the Photon fork to get the benefit of their work.
Anyway, looking at your log it appears that 3DMigoto never intercepted the call to D3D11CreateDevice / D3D11CreateDeviceAndSwapChain in d3d11.dll, so was never able to wrap DirectX properly, so when it did intercept the call to CreateSwapChainForHwnd in dxgi.dll it wasn't able to find the device wrapper since it never had the chance to create one, and errors out because there's no way for it to continue without that.
How are you loading 3DMigoto in to the game? Are you trying to use the external 3DMigoto loader exe like the GI modders typically use on Windows, and if so do you have the files in the game directory, or in an external directory (I guess the later from your logs)?
Or, if you are not using the external loader, are you relying on d3d11.dll being in the same directory as the game (I guess not), or are you using some other method to load 3DMigoto (like LD_PRELOAD, or overriding which library WINE is using for d3d11.dll)?
These questions are important, because the answers fundamentally change how 3DMigoto attempts to intercept the CreateDevice APIs
I'd usually suggest trying to place 3DMigoto and your mods in the game directory and NOT using the external loader as that is how it normally operates in 99% of games, but I don't know if the GI modders had a good reason for not doing it this way - e.g. they told me that GI bans users who modify their game files, and perhaps this extends to adding new files to the game directory, so try this experiment at your own risk.
I can see in your log that it was able to intercept the CreateSwapChain call, which is always intercepted via deviare-in-proc hooks, but didn't intercept the CreateDevice APIs, which may either indicate that 3DMigoto thought it could rely on wrapping those (normal operation), or if it did hook them could indicate that it was loaded too late to be able to intercept them. Unfortunately 3DMigoto has to make this decision very early the moment it is loaded before it is able to (safely) open or write anything to the log file, so I can't actually tell which decision it made from the log.
The way that it would usually work on Windows is that 3DMigoto would wrap the CreateDevice APIs if it is loaded from the game directory as d3d11.dll, or hook them if it has been loaded from an external directory or is under a different name. The logic isn't quite based on the directory it is loaded from though - rather it tries to determine whether the dynamic linker is returning 3DMigito or the real DirectX when something asks for "d3d11.dll".
My guess is that this is where WINE/Linux begins to differ from Windows behaviour. I can concieve of a few possible scenarios that could be causing this - we'll need to narrow down which of these is actually happening, or if there is some other possibility that I haven't thought of:
-
DirectX is loaded before 3DMigoto, but GetModuleHandleA("d3d11.dll") returns 3DMigoto's handle instead of DirectX (deviating from Windows behaviour), making 3DMigoto think it won't need to hook the CreateDevice APIs.
-
DirectX is not loaded, so GetModuleHandleA("d3d11.dll") returns 3DMigoto's handle and 3DMigoto does not hook the CreateDevice APIs, but later when the real DirectX is loaded the linker ends up giving it priority of those calls over 3DMigoto despite being loaded 2nd, deviating from Windows behaviour. (This is actually somewhat likely, ld.so has some fundamental differences in how it resolves symbols provided by multiple libraries compared to the Windows dynamic linker that has caused me trouble in other cross platform projects in the past where malloc family of calls were sent to the wrong library, and I'm not sure if WINE accounts for these differences).
-
WINE may be overriding which d3d11.dll is called for the D3D11CreateDevice APIs. This is quite plausible, as WINE does have settings to change which specific DLLs it provides itself vs which use the native Windows version, and I don't know how it behaves when an additional DLL like 3DMigoto is added to the mix.
-
The game calls D3D11CreateDevice() (not the ...AndSwapChain variant) before 3DMigoto has been loaded, then 3DMigoto is injected, then the game calls CreateSwapChainForHwnd. The decision to hook or wrap won't matter in this scenario as 3DMigoto is loaded too late for either to work. This is probably only plausible if the external loader has been used to inject 3DMigoto into the game, particularly if the behaviour of SetWindowsHookEx under WINE deviates from Windows, and even if that is the case it seems unlikely as it is a race condition and would require some pretty unfortunate timing to actually occur.
If you are using the external loader, try renaming 3DMigoto's d3d11.dll to something else (e.g. "3dmigoto.dll"), and in d3dx.ini find the [Loader] section and change the module= setting to match. This should force 3DMigoto to hook the CreateDevice APIs regardless of how the dynamic linker and WINE are behaving, which (fingers crossed) might be enough to get past this hurdle.
Even if it doesn't ultimately get you into the game, I'd appreciate a log file trying this as it might get a little further or provide some more clues.
Sorry for the late reply, i was asleep x), i indeed renamed d3d11.dll to 3dmigoto.dll, because it raises an error if i dont do so. Someting like Wine Direct3D is not 3dmigoto, it may be overriding the dll. I also removed the nvapi64.dll because it caused errors and i dont think i need it. Sadge older nvidia cards like mine has very bad drivers on linux, it does not support a lot of things, i might consider switching to amd. I run the game from an external directory but on the same wine prefix, so its able to locate the game only by target = GenshinImpact.exe. I also heard that placing files into the game directory bans you, so i skipped that. I load 3dmigoto before the game starts, otherwise it just keeps searching for the game.
Sorry for the late reply, i was asleep x), i indeed renamed d3d11.dll to 3dmigoto.dll
Hmm, in that case it should be using hooking for the CreateDevice calls, so it's not clear why we aren't seeing any sign of it intercepting those calls. Possibly this might be a limitation of WINE preventing us from hooking exported DLL functions, or preventing hooks on those functions from working. We know hooks work on the CreateSwapChain calls, but those are COM methods, not DLL exports. We will need to do some more digging here.
because it raises an error if i dont do so. Someting like Wine Direct3D is not 3dmigoto, it may be overriding the dll.
This error?
printf("ERROR: The requested module \"%s\" is not 3DMigoto\n"
"Please ensure that [Loader] \"module\" is set correctly and the DLL is in place.", module_path);
That would suggest that WINE is overriding the search path of GetFileVersionInfoA. I would consider this a WINE bug as the current directory should be taking priority over the system directory to match Windows behaviour, but this may not be something they can do much about.
To me this just says that WINE isn't designed with tools like 3DMigoto in mind and probably just isn't behaving close enough to Windows for it to work.
I also removed the nvapi64.dll because it caused errors and i dont think i need it.
Very few mods need that (even most 3D Vision mods don't actually need it) and it should be fine to remove.
Sadge older nvidia cards like mine has very bad drivers on linux, it does not support a lot of things, i might consider switching to amd.
Eh, I think AMD support has only ever been pretty average on Linux, though I think I recall they did a massive re-write of their driver some years back that was supposed to improve things.
Which nvidia driver are you using? The Proprietary one or Nouveau?
I run the game from an external directory but on the same wine prefix, so its able to locate the game only by target = GenshinImpact.exe.
It's been years since I ran anything under WINE - can you give me a quick refresher of how to set this up so I can try to reproduce this myself?
I load 3dmigoto before the game starts, otherwise it just keeps searching for the game.
I tried launching later, and it was an error with the wineserver already running, can it be that the game crashes because it tries running more than one exe, on the same prefix?
Right, it needs to be started before the game even on Windows otherwise it won't be loaded early enough to intercept DirectX initialisation. To be perfectly honest, I'm a little surprised that the injector works at all under WINE, but I guess they found some other need to implement SetWindowsHookEx - in Windows using that mechanism is actually pretty horrible as it can't target a specific application so it loads 3DMigoto into every newly spawned process while the launcher is running, which can noticeably slow down the system, so I have code that immediately unloads 3DMigoto from every unintended process and the launcher exits as soon as it confirms a successful injection to stop loading it into other processes... Under Linux it would probably be better to use LD_PRELOAD since that can target injection into a specific binary, though I'm not sure if that mechanism works with WINE executables and DLLs.
Yes it is printing that error. I use the proprietary driver, i see there an open source nvidia one but my gpu is old for that. I tried setting the launch into the path of the game in the config it works the same as i done earlier. Basicly it needs to run in the same instance otherwise it would print the wineserver error. With LD_PRELOAD, the same file and error occurs, the game quits itself. Im kinda sad because i like modding games, but it is what is. Thank you very much for helping me :).
I've spoken with a Linux enthusiast earlier regarding 3Dmigoto compatibility, and he might have some direct information about this problem. Calling @frostworx, and also probably @sonic2kk who is maintaining the SteamTinkerLaunch tool, which is reported as working with geo-11, and so should work here.
https://github.com/sonic2kk/steamtinkerlaunch/wiki/Side-by-Side-VR
@frostworx, @sonic2kk: This is possibly worth some of your attention as a Linux related compatibility issue when using 3Dmigoto tools.
@BudayBoldi: You might want to skim the wiki for SteamTinkerLaunch and see if anything helps explain your error. Also worth looking at known good/known working games to be sure your installation is working. 3Dmigoto has been tested and is working in Linux by frostworx, but I'm not sure what versions. It would be helpful to know if this is game specific.
Sorry for the late reply i got home late :). I tried the tool, i love it but the same issue still occurs, im gonna try another migoto dll, it might work, which one do you prefer?
I am not sure if this will help in your case, but one of our community members has created a guide specifically for getting 3dmigoto functional for genshin impact on Linux: https://www.youtube.com/watch?v=pcvoZTo-q9A - I have never personally tried to get it operational, but from what I have heard it works reasonably well with a few minor glitches.
Also, if you are on the genshin modding discord (agmg), we also have a dedicated channel for linux support (thread in verification-support) specifically for genshin impact - there is quite a long list of problems/solutions (sorry, not my intent to advertise the server, just hard to summarize all the troubleshooting from that channel in a few paragraphs).
With regards to putting the dll in the program folder, it isn't an option for GI - the company specifically detects and deletes foreign files in the game folder before operation. There are a few methods to bypass their folder checks, but I have avoided using/publicizing them since I know they have banned in the past for messing with game files.
This is kinda weird, i followed your suggestion, i have no more errors, and 3dmigoto loads succesfully, but not ingame. @SilentNightSound Do i need something to do after i launch the game, or maybe my mod is broken too. I join your discord, and thanks for all the help. Its nice to see how linux gets a lot of support.
@BudayBoldi Double check it has actually loaded, either by seeing if the help menu pops up (should show up in bottom left corner with controls on game start) or if pressing F10 (reload) causes a brief stutter. Genshin often sends false data or doesn't respond to checks that the dll is loaded properly, so sometimes the loader can incorrectly say the dll has loaded in without it actually working.
Double check you have extracted mods to the Mods folder as well, and make sure to run the loader as admin (or with sudo in linux I suppose) - genshin runs with highest privileges in Windows due to its kernel-level anticheats, so the loader needs to be admin in order to inject.
The most recent version of the game (4.1) broke almost every single mod, but they should still show up (they will just look damaged/be missing parts).
I dont see any menu f1 nor f10 does not seem to do anyrhing. Running as sudo dosnt do anything too, but sorry i did get a log previously i just noticed. Maybe this helps:
D3D11 DLL starting init - v 1.3.16 - Tue Oct 17 01:16:50 2023
Game path: Z:\home\user\Games\Heroic\GenshinImpact\Genshin Impact game\GenshinImpact.exe 3DMigoto path: C:\Program Files\3dmigoto\d3d11.dll
----------- d3dx.ini settings ----------- [Logging] calls=1 input=1 debug=0 unbuffered=0 force_cpu_affinity=0 crash=0 debug_locks=0 [Include] include_recursive=Mods Searching "C:\Program Files\3dmigoto\Mods*" Searching "C:\Program Files\3dmigoto\Mods\BufferValues*" Processing "C:\Program Files\3dmigoto\Mods\BufferValues\HealthBar.ini" namespace=global\HealthBar Renaming namespace "Mods\BufferValues\HealthBar.ini" -> "global\HealthBar" exclude_recursive=DISABLED* include=ShaderFixes\help.ini [System] load_library_redirect=2 allow_check_interface=1 allow_create_device=1 allow_platform_update=1 check_foreground_window=1 [Device] upscaling=0 full_screen=0 force_stereo=0 get_resolution_from=swap_chain hide_cursor=0 [Stereo] automatic_mode=0 create_profile=0 force_no_nvapi=0 [Rendering] shader_hash=3dmigoto override_directory=ShaderFixes cache_directory=ShaderCache cache_shaders=0 rasterizer_disable_scissor=0 assemble_signature_comments=1 disassemble_undecipherable_custom_data=1 patch_assembly_cb_offsets=1 recursive_include=1 export_fixed=0 export_shaders=0 export_hlsl=0 dump_usage=1 stereo_params=125 ini_params=120 fix_sv_position=0 [Hunting] hunting=2 reload_config=no_modifiers VK_F10 wipe_user_config=ctrl alt no_shift VK_F10 monitor_performance=ctrl no_shift no_alt F9 freeze_performance_monitor=no_ctrl shift no_alt F9 monitor_performance_interval=2.000000 take_screenshot=no_modifiers VK_SNAPSHOT toggle_hunting=no_modifiers NO_VK_DECIMAL VK_NUMPAD0 repeat_rate=6 marking_mode=skip next_marking_mode=no_modifiers VK_DECIMAL VK_NUMPAD0 marking_actions=hlsl asm clipboard regex stereo_snapshot snapshot_if_pink next_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD2 previous_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD1 mark_pixelshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD3 next_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_MULTIPLY previous_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_DIVIDE mark_vertexbuffer=no_modifiers NO_VK_DECIMAL VK_SUBTRACT next_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD8 previous_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD7 mark_indexbuffer=no_modifiers NO_VK_DECIMAL VK_NUMPAD9 next_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD5 previous_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD4 mark_vertexshader=no_modifiers NO_VK_DECIMAL VK_NUMPAD6 next_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD2 previous_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD1 mark_computeshader=no_modifiers VK_DECIMAL VK_NUMPAD3 next_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD5 previous_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD4 mark_geometryshader=no_modifiers VK_DECIMAL VK_NUMPAD6 next_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD8 previous_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD7 mark_domainshader=no_modifiers VK_DECIMAL VK_NUMPAD9 next_hullshader=no_modifiers VK_DECIMAL VK_MULTIPLY previous_hullshader=no_modifiers VK_DECIMAL VK_DIVIDE mark_hullshader=no_modifiers VK_DECIMAL VK_SUBTRACT done_hunting=NO_MODIFIERS NO_VK_DECIMAL VK_ADD reload_fixes=no_modifiers VK_F10 show_original=no_modifiers VK_F9 analyse_frame=no_modifiers VK_F8 analyse_options=dump_rt dump_tex dump_cb dump_vb dump_ib buf txt verbose_overlay=1 [Resource\ShaderFixes\help.ini\Font] filename=LiberationSans-Bold.dds [Resource\ShaderFixes\help.ini\Help] [Resource\ShaderFixes\help.ini\HelpCS2GS] type=StructuredBuffer array=4096 stride=16 [Resource\ShaderFixes\help.ini\HelpFull] filename=help.txt type=buffer format=R8_UINT [Resource\ShaderFixes\help.ini\HelpShort] filename=help_short.txt type=buffer format=R8_UINT [Resource\ShaderFixes\help.ini\Notification] [Resource\ShaderFixes\help.ini\NotificationCS2GS] type=StructuredBuffer array=4096 stride=16 [Resource\ShaderFixes\help.ini\NotificationParams] type=StructuredBuffer array=1 data=R32_FLOAT -1.00 -1.0 +1 -1.0 0.25 1 0.25 1 0 0 0 0.75 0.00 0.00 1 3 0 1.0 [Resource\ShaderFixes\help.ini\Params] [Resource\ShaderFixes\help.ini\ParamsFull] type=StructuredBuffer array=1 data=R32_FLOAT -0.8 0.9 0.8 -1 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 1 0 1.0 [Resource\ShaderFixes\help.ini\ParamsShort] type=StructuredBuffer array=1 data=R32_FLOAT -0.93 -0.9 +1 -0.9 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 3 1 1.0 [Constants] global $costume_mods=1.000000 global $version=7.000000 global $\global\healthbar\health=-1.000000 global $\global\healthbar\hpbarcount=0.000000 global $\global\healthbar\total=100.000000 global $\global\healthbar\ispartyswaploadbar=0.000000 global $\global\healthbar\auxt=0.000000 global $\global\healthbar\hpactive=0.000000 global $\shaderfixes\help.ini\last_window_width global $\shaderfixes\help.ini\last_window_height global $\shaderfixes\help.ini\notification_timeout resourcehelp = ref resourcehelpshort resourceparams = ref resourceparamsshort [Key\ShaderFixes\help.ini\Help] type=toggle run=CommandListHelp Key=no_modifiers F1 [KeyToggleMods] type=cycle Cycle 1: $costume_mods=0 Cycle 2: $costume_mods=1 Key=no_modifiers F6 [builtincustomshaderdisablescissorclipping] scissor_enable=0 rasterizer_state_merge=1 draw = from_caller handling = skip [customshader\shaderfixes\help.ini\rendertext] vs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- gs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- ps=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- [builtincustomshaderenablescissorclipping] scissor_enable=1 rasterizer_state_merge=1 draw = from_caller handling = skip [customshader\shaderfixes\help.ini\formattext] cs=help.hlsl --------------------------------------------- BEGIN --------------------------------------------- ---------------------------------------------- END ---------------------------------------------- [builtincommandlistunbindallrendertargets] o0 = null o1 = null o2 = null o3 = null o4 = null o5 = null o6 = null o7 = null od = null [commandlist\shaderfixes\help.ini\help] pre resourcehelp = ref resourcehelpfull pre resourceparams = ref resourceparamsfull pre run = customshaderformattext pre resourcehelpshort = null post resourcehelp = null [commandlistskin] if $costume_mods checktextureoverride = ps-t0 checktextureoverride = ps-t1 checktextureoverride = ps-t2 checktextureoverride = ps-t3 checktextureoverride = vb0 checktextureoverride = vb1 checktextureoverride = vb2 checktextureoverride = ib x140 = 0 endif [commandlistunbindallrendertargets] run = builtincommandlistunbindallrendertargets [ShaderOverride\global\HealthBar\GroundHealthPS] Hash=000d2ce199e12697 allow_duplicate_hash=overrule if $hpactive && ps-t0 == 34 && $ispartyswaploadbar == 1 $hpbarcount = $hpbarcount+1 if $hpbarcount == $total && $auxt%15 == 0 store = $health, ps-cb0, 33 endif endif [ShaderOverride\global\HealthBar\Map] Hash=df48ebf15d4e5d80 $ispartyswaploadbar=1 [ShaderOverrideCharacter] Hash=653c63ba4a73ca8b run = commandlistskin [ShaderRegexEnableTextureOverrides] shader_model=vs_4_0 vs_4_1 vs_5_0 vs_5_1 run = commandlistskin ShaderRegex hash: 441e075f [TextureOverride\global\HealthBar\Icons] Hash=00000000ef054414 filter_index=34.000000 [Present] post $auxt=$auxt+1 post $total=$hpbarcount post $hpbarcount=0 post $ispartyswaploadbar=0 post $h
Sorry, how does this involve SteamTinkerLaunch, exactly? I don't maintain any of the tools here, and compatibility issues with downstream tools that SteamTinkerLaunch integrates with aren't really relevant. If you think there is something relevant, you'll need to open a SteamTinkerLaunch issue.
But since this appears to be a Windows tool that STL doesn't touch, I don't think it has anything to do with me...
Everyrhing worths a try, btw i have made it launch with that tool, i just added the game to my steam library. Great tool, im gonna use it with other games for sure.
Sorry, how does this involve SteamTinkerLaunch, exactly? I don't maintain any of the tools here, and compatibility issues with downstream tools that SteamTinkerLaunch integrates with aren't really relevant. If you think there is something relevant, you'll need to open a SteamTinkerLaunch issue.
But since this appears to be a Windows tool that STL doesn't touch, I don't think it has anything to do with me...
Not directly related. I've just worked with Frostworx in the past to help get 3Dmigoto working in Linux, and thought it might be interesting to him to see this particular problem. However, it looks like he has passed support of SteamTinkerLaunch to you, which is why I added you as a person of possible interest.
3Dmigoto is a general modding tool, and can be used on all games, so it's helpful for us to know where it works in Linux. We know it works in Linux, but don't have any real experience there, so I just try to let other more knowledgeable people like yourself know about it.
Sorry, I can't help here. I almost gave up gaming completely and can't tell anything about current Linux/Proton compatibility...
This is kinda weird, i followed your suggestion, i have no more errors, and 3dmigoto loads succesfully, but not ingame. @SilentNightSound Do i need something to do after i launch the game, or maybe my mod is broken too. I join your discord, and thanks for all the help. Its nice to see how linux gets a lot of support.
Same here. I followed the guide and it did show up a windows terminal and said game found. However there is no prompt on the LOGO screen. But I am using proton while the guy in the guide uses Lutris. Maybe there is some command I need to type.
In case you want more information, here are my logs d3d11_log.txt, and nvapi_log.txt.