iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
278 stars 23 forks source link

nGlide wrapper only displays a black screen. #86

Open KynikossDragonn opened 4 years ago

KynikossDragonn commented 4 years ago

The nGlide glide wrapper which wraps all known Glide API's to Direct3D 9 just seems to black screen on just about anything I've tried it on. I don't get any meaningful output that would tell me what's possibly going wrong.

Other actual Direct3D 9 games work fine, but I have a few specific things in Wine I need to use the nGlide wrapper on.

I am aware of dgvoodoo2 but I've yet to look into DXVK.

Here's some system information:

Kernel: Linux 5.8.8
Wine version: 5.16
CPU: Intel Core i7-6770HQ
GPU: Intel Iris Pro 580
Mesa driver: iris_dri.so
Mesa version: 20.1.7
Wine Nine version: v0.7.0-368-release

Games tested that resulted in a black screen with nGlide:

Unreal (all versions)
Starsiege
Starsiege: Tribes (aka Tribes 1)
Recoil

I presume everything is working in DRI3 as that's what iris_dri.so and Mesa as a whole defaults to.

iris_dri.so is a Gallium driver.

dungeon007 commented 4 years ago

Try gdi wine renderer for nglide apps or some ddraw wrapper. It is probably same bug like in: https://github.com/iXit/Mesa-3D/issues/336 Not solved yet, but at least have workarounds. Seems some sort of collision bug that happens here and there, between wine's gpu accelerated ddraw and nine.

KynikossDragonn commented 4 years ago

Yeah this workaround appears to work in this instance too. Only instead of setting that key globally you can set it in the AppOverrides section even though winecfg never reveals that set of options to you.

That's a pretty odd regression if it's indeed a wine problem.

dungeon007 commented 4 years ago

Sure, you can edit registry per app to force gdi and else. Many ddraw wrappers also workarounding it, like dxgl, dxwrapper, many ddraw wrappers that come with some GoG games, etc... Even running software mesa for windows also workarounds it: https://fdossena.com/?p=mesa/index.frag Copy in game folder and override it with something like WINEDLLOVERRIDES=opengl32=n Weird is that software mesa for windows is also a workaround, but seems just forcing things like LIBGL_ALWAYS_SOFTWARE=true isnt :D Yeah, there are many ways to workaround it, depending if you like editing registry or variables, still nicest would be if it just work by default...

dungeon007 commented 3 years ago

These apps just missies front buffer it seems... dxvk with forced disabled flag like: d3d9.noExplicitFrontBuffer = False Also needs GDI renderer... maybe we are just missing something, maybe some quirk is possible in front/back buffer code.

lorn10 commented 1 year ago

And here follows an update to this topic. I can confirm this behavior also for the GOG version of Rayman 2: The Great Escape and latest nGlide 2.10.

However, in my case the screen output remains black also after applying the above mentioned gdi tweak to the registry:

[HKEY_CURRENT_USER\Software\Wine\Direct3D]
"Renderer"="gdi"

The sole difference is that before the change my screen output was white while now it is black. So it looks that this "gdi" setting doesn't helps in any case. I tried many different resolutions (in the game) from 1920 x 1080 down to 640 x 480 with the same result. Also the color setting of 32 bit versus 16 bit doesn't bring an improvement.

Interestingly there seems to be something strange when Gallium Nine is initialized. It looks that several approaches are needed until Gallium Nine is finally active:

test@test-iMac:~$ cd "/home/test/.wine_GOG/drive_c/GOG Games/Rayman 2"
test@test-iMac:~/.wine_GOG/drive_c/GOG Games/Rayman 2$ WINEPREFIX=~/.wine_GOG wine Rayman2.exe
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0024:err:winediag:wined3d_dll_init Disabling 3D support.
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x35e468), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x35e468), stub!
0024:err:vulkan:wine_vk_init Failed to load libvulkan.so.1.
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
Native Direct3D 9 v0.9.0.396-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x10cdd00), stub!
014c:fixme:keyboard:LoadKeyboardLayoutW name L"00000807", flags 1, semi-stub!
014c:fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x8070807, 0000: semi-stub!

I was able to produce two small apitraces: d3d9_16bit_colors.trace.tar.gz d3d9_32bit_colors.trace.tar.gz

Edit: This seems to be a problem of the r600 Mesa driver because it works fine with the crocus driver on my Intel iGPU. :+1:

Addition: I can confirm that the problem is no longer present on later Mesa builds. So while Mesa 23.0.4 is affected Mesa 23.3 devel works fine. In the end the sole and only needed change for nGlide is the "Renderer"="gdi" modification in the registry which is more a problem of Wine than of Gallium Nine.

fspkwon commented 3 months ago

what your trying to accomplish is to actually switch crocus probably to iris? since thats the driver effecting the issue apparently is nigh its not the driver set your opengl supported max version to 2.1 and itll start working as for the wine-d3dx9 thats actually broken set shaders to use arb <- which will fix your black screen itll say d3dx9 works but the driver does actually nothing for it is probably because dri2 is broken so would need to switch to uxa compositor? <- that should fix all issues however on archlinux i find gallium9 doesnt work no matter what your gonna try to do , dxvk isnt even a problem with wine its a problem for the driver and or runtime itself where it says the specific iris plux xe 640 card the one with alot of ram but when you look at dedicated ram is only 128mb this could mean as a coder itll work as a gamer it wont

fspkwon commented 3 months ago

thats an intel gma950 i think has more ram than a iris plus xe 640 a gma 3100 has more ram than the iris plus xe: but we are on the GPU Side of things is what that means for the Iris Plus XE User:

fspkwon commented 3 months ago

so .bashrc: export WINEARCH=win32 export WINEPREFIX=/home/*****/.wine export D3D_BACKEND=dri2 export MESA_LOADER_DRIVER_OVERRIDE=iris export MESA_GL_VERSION_OVERRIDE=2.1

fspkwon commented 3 months ago

This is however one does this: Section "Module" Load "dri3" Load "dri2" Load "dri" Load "glx" Load "extmod" EndSection

Section "Device"

Available Driver options are:-

    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
    ### <percent>: "<f>%"
    ### [arg]: arg optional
    Option     "Accel"                   "True"
    Option     "AccelMethod"             "uxa"
    Option     "DRI"                     "2"
    Option     "Tiling"                  "True"
    Option     "LinearFramebuffer"       "False"
    Option     "VSync"                   "False"
    Option     "PageFlip"                "True
    Option     "SwapbuffersWait"         "False"
Option     "TripleBuffer"            "False"
    Option     "XvMC"                    "True"
    Option     "TearFree"                "False"
    Option     "BufferCache"             "True"
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"

EndSection

fspkwon commented 3 months ago

And on the WINE end of things: HKEY_CURRENT_USER/Software/Wine:

[Key "X11 Driver"]: String ClientSideWithCore = Y String ClientSideWithRender = Y

[Key "Direct3D"]: dword csmt = 0x3 just enter the number 3 String DirectDrawRenderer = opengl String shader_backend = arb <- this is a must as aside of resolution issues it doesnt do shading String use_glsl = true String VideoMemorySize = 128

Then close regedit after running wine regedit and type wineboot and do whatevers at the will of the user to try i dont think muchll work without some of those parts working though: d3dx9 like i said appears broken on archlinux for no reason<- gallium9 doesnt work dxvk is why that workaround in a first place

fspkwon commented 3 months ago

and for the DXVA2 things of things you want that to be entirely software but i dont know how to so i will instead of using va enter qsv and maybe that does something

fspkwon commented 3 months ago

and heres your error <- is specifically the same as vulkan :err:d3d:wined3d_debug_callback 06291058: "GL_OUT_OF_MEMORY