wine-nine-standalone icon indicating copy to clipboard operation
wine-nine-standalone copied to clipboard

Switching over D3D9

Open guglovich opened this issue 2 years ago • 7 comments

I'm interested in switching between d3d9 wine and d3d9-nine. If I just disable or delete d3d9-nine I get an error that there is no d3d9, i.e. I can only use wine-nine.

guglovich avatar May 30 '22 15:05 guglovich

Yes, I can confirm this behavior. When Gallium Nine is installed into a Wine prefix then it is not possible to simply disable it and use again WineD3D. I also get a d3d9.dll "not found" message. However, when I enable it again in ninewinecf everything starts to work properly.

So it looks that it is better to be carefully with installing Gallium Nine to a Wine prefix. I would recommend to work with different prefixes. You can use some for games and some for other applications. And finally, it is also possible to run an application from a non-Gallium Nine prefix via an other prefix which has installed Gallium Nine. :+1:

test@test-iMac:~$ wine64 ninewinecfg
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
0110:fixme:imm:ImeSetActiveContext (0000000000255CF0, 1): stub
0110:fixme:imm:ImmReleaseContext (0000000000010054, 0000000000255CF0): stub
Native Direct3D 9 v0.8.0.385-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
0068:fixme:imm:ImeSetActiveContext (0000000000056CE0, 0): stub
0068:fixme:imm:ImmReleaseContext (0000000000010020, 0000000000056CE0): stub
test@test-iMac:~$ cd /home/test/Downloads/Cxbx/2022
test@test-iMac:~/Downloads/Cxbx/2022$ WINEPREFIX=~/.wine wine /home/test/Downloads/Cxbx/2022/cxbx.exe
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
0024:err:module:import_dll Library d3d9.dll (which is needed by L"Z:\\home\\test\\Downloads\\Cxbx\\2022\\cxbx.exe") not found
0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\test\\Downloads\\Cxbx\\2022\\cxbx.exe" failed, status c0000135

lorn10 avatar Jun 03 '22 11:06 lorn10

It's a pity, I wanted everything to be quick and easy with the GUI. Tried PortProton, there's a choice of Gallium Nine or DXVK before each run. But it doesn't work well with my game. If anyone has any other ways to work write.

@iXit perhaps there is a command to run it? for example, by loading the library as an external library via the LD_PRELOAD option

guglovich avatar Jun 03 '22 11:06 guglovich

In theory it should work. To load nine you need both nine's d3d9.dll to be loaded, and the nine mesa library to be either in the standard system locations, or the proper wine registry be set. wine ninewinecfg does check the mesa lib loads correctly, and it so you can replace or not the wineprefix d3d9.dll with the nine one.

If you want to bypass ninewinecfg, you can. You just need to handle manually the loading of nine's d3d9.dll. For example put the dll in the game dir, and set d3d9 to load the native dll (native does look first in the exe dir). Or write your own script to replace the system d3d9.dll. Possibly with proton it doesn't work because maybe proton handles the loading of d3d9.dll differently or stores it diferently to what ninewinecfg expects. ninewinecfg backs up the previous dll, somehow that part may not be working in that scenario.

axeldavy avatar Jun 06 '22 21:06 axeldavy

I tried throwing in the .exe files and specifying the paths to the first win-nine activation, but it didn't work.

env LD_PRELOAD='/Media/Games/Lineage_2/GW/system/nine_sdl.so' MANGOHUD=1 wine /Media/Games/Lineage_2/GW/system/l2.exe

env D3D_MODULE_PATH='/Media/Games/Lineage_2/GW/system/d3dadapter9.so' MANGOHUD=1 wine /Media/Games/Lineage_2/GW/system/l2.exe

guglovich avatar Jun 06 '22 23:06 guglovich

preloading the .so won't work because it is loaded dynamically by the dll. What is important is the dll.

axeldavy avatar Jun 07 '22 05:06 axeldavy

It depends on how you installed this package. If you use winetricks or the bundled nine-install.sh, the checkbox in ninewinecfg should just work. For automation you can use its cmdline arguments -e/-d arguments.

If a prefix is missing files you can restore the wine files if you remove ~/.wine/.update-timestamp and run e.g. winecfg.

dhewg avatar Jul 16 '22 07:07 dhewg

Installing through winetricks. Installing from repository doesn't work or I don't understand how to run. Ninewinecfg itself disables dx9 native, but then winetricks can't see its own libraries.

guglovich avatar Jul 19 '22 04:07 guglovich