https://bugs.winehq.org/show_bug.cgi?id=45430
Bug ID: 45430 Summary: Improve diagnostics of 'D3DxxCreateDevice' failures for warp driver type (D3D10_DRIVER_TYPE_WARP or D3D_DRIVER_TYPE_WARP) Product: Wine Version: 3.11 Hardware: x86-64 OS: Linux Status: NEW Severity: enhancement Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
for improving diagnostics of unsupported drivers with 'D3DxxCreateDevice'.
While trying out some games which support the DX11 Warp software renderer on Windows platforms (https://docs.microsoft.com/en-us/windows/desktop/direct3darticles/directx-wa...) using command line, the output was not super useful. In fact it's a bit inconsistent.
'D3D10CreateDevice1' -> handles 'D3D10_DRIVER_TYPE_WARP' explicitly in fixme trace
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3d10_1/d3d10_1_main....
'D3D11CreateDevice' -> default (error) case, only enum value printed
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3d11/d3d11_main.c#l1...
'D3D10CreateDevice' -> default (error) case, only enum value printed
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3d10/d3d10_main.c#l3...
--- snip --- ... 0030:Ret ucrtbase.memcpy() retval=0022ea88 ret=140e19601 0030:Call d3d11.D3D11CreateDeviceAndSwapChain(00000000,00000005,00000000,00000000,0022f3d8,00000003,00000007,0022f3f0,2127fb38,2127fb30,2127fb40,0022f3d0) ret=140b91f80 0030:Call dxgi.CreateDXGIFactory1(7f270d9df180,0022edf0) ret=7f270d975d1e 0030:trace:dxgi:CreateDXGIFactory1 iid {7b7166ec-21c7-44ae-b21a-c9ae321ae369}, factory 0x22edf0. ... 0030:trace:d3d:wined3d_create Created wined3d object 0xc6c620. 0030:Ret wined3d.wined3d_create() retval=00c6c620 ret=7f270d905c55 0030:Call wined3d.wined3d_mutex_unlock() ret=7f270d905c74 0030:Ret wined3d.wined3d_mutex_unlock() retval=00000000 ret=7f270d905c74 0030:trace:dxgi:dxgi_factory_create Created factory 0xc6c5d0. 0030:trace:dxgi:dxgi_factory_QueryInterface iface 0xc6c5d0, iid {7b7166ec-21c7-44ae-b21a-c9ae321ae369}, out 0x22edf0. 0030:trace:dxgi:dxgi_factory_AddRef 0xc6c5d0 increasing refcount to 2. 0030:trace:dxgi:dxgi_factory_Release 0xc6c5d0 decreasing refcount to 1. 0030:Ret dxgi.CreateDXGIFactory1() retval=00000000 ret=7f270d975d1e 0030:fixme:d3d11:D3D11CreateDevice Unhandled driver type 0x5. ... 0030:Ret d3d11.D3D11CreateDeviceAndSwapChain() retval=80004005 ret=140b91f80 ... --- snip ---
It later crashes, likely due to missing WARP driver support.
Having the unhandled WARP driver type explicitly "stringified" could improve the situation of diagnosing end user problems. I actually had to look up the enum value.
Might be a bit off-topic to this ticket: Is Direct3D 11 WARP driver support ever considered in Wine? I guess getting DX11+ feature support with hardware drivers to work perfectly (tm) is much higher priority. The MS website (https://docs.microsoft.com/en-us/windows/desktop/direct3darticles/directx-wa...) lists some interesting use-cases though.
Regards
https://bugs.winehq.org/show_bug.cgi?id=45430
--- Comment #1 from Henri Verbeet hverbeet@gmail.com --- Created attachment 61761 --> https://bugs.winehq.org/attachment.cgi?id=61761 patch
Does the attached patch work for you?
https://bugs.winehq.org/show_bug.cgi?id=45430
--- Comment #2 from Henri Verbeet hverbeet@gmail.com --- (In reply to Anastasius Focht from comment #0)
Might be a bit off-topic to this ticket: Is Direct3D 11 WARP driver support ever considered in Wine? I guess getting DX11+ feature support with hardware drivers to work perfectly (tm) is much higher priority. The MS website (https://docs.microsoft.com/en-us/windows/desktop/direct3darticles/directx- warp) lists some interesting use-cases though.
I haven't looked much into what would be required to make that work, but I suspect it would involve adopting the Windows D3D driver model and loading the WARP driver. That's unlikely to happen.
In the more general sense of explicitly selecting a software renderer, the GLX_MESA_query_renderer extension in theory has to capability to enumerate and select software renderers like llvmpipe in addition to hardware GPUs, and I think using that capability to implement "WARP" would be fine. Last time I checked that part of the extension wasn't actually implemented in Mesa though, so that would need to be made to work first.
https://bugs.winehq.org/show_bug.cgi?id=45430
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello Henri,
with the patch applied it prints the diagnostics and then runs into bug 45431 ("Crash Bandicoot N. Sane Trilogy (Steam, D3D11 game) deadlocks in IDXGISwapChain::ResizeTarget while trying to resize window") due to hardware fallback.
--- snip --- $ pwd /home/focht/wine-games/wineprefix64-cb/drive_c/Program Files (x86)/Crash Bandicoot N Sane Trilogy
$ wine ./CrashBandicootNSaneTrilogy.exe -help
Usage: game [OPTION] ... @[FILE] Game Engine
Testing: -st, --smoketest ARG Execute smoketest. -stm, --smoketestmap ARG Map(s) being smoke tested -sth, --smoketestheroes ARG Hero(s) being smoke tested -fst, --finalsmoketest Final build smoke test (cruder version of full smoketest) -gt, --gametest Execute Game Engine Tests -cc, --codecoverage ARG Run code coverage. -sttr, --smoketestthreadedrenderAllow threaded render during smoketest (breaks golden images) -sp, --saveprogress If we want to save our SmokeTest progress -dx, --debugxml Load the debug.xml file during smoketest. -frh, --forcereporthandler Force the report handler callback. -mm, --memorymonitor Enable Memory Monitor -sr, --setregistry ARG Set a registry key -wfdh, --waitForDurangoHost Spam CTRL-Z at the end of smoketest so that DurangoHost.py can quit gracefully. -om, --overridemap ARG Map to use in place of debug map from configuration file.
Build: -b, --build Attempt to start and connect to a build server instance just for this process. -bs, --build-server ARG Address and port of a build server (localhost:1000) -ba, --build-arguments ARG Command-line arguments to pass to the build server -bfd, --build-final-data Request final data from the build server. -ps4dm, --ps4developmentmode PS4 Development Mode
Online: -mmtid, --matchmaking-title-id ARGThe title id to use for online matchmaking
Misc: -pc, --primarycontroller ARG The primary controller to use [1,2,3,4] when launching into a map. -wd, --windowdatafile ARG The window settings datafile to use. Defaults to WindowData.igx. -h, --host ARG Name of host computer. -dn, --dotnet ARG Port to use for DotNet debugging (7265) -wfdd, --waitForDotNetDebuggerWait for the DotNet debugger to fully connect before starting a level. -wfvd, --waitForVscDebugger Wait for the Visual Script debugger to fully connect before starting a level. -gc, --gamecomm ARG Port to use for Game Communication (30001) -hm, --headlessMode Run in headless mode. -gm, --gameMode ARG Set the game mode. -warp, --dx11warp Use the DX11 Warp software renderer on Windows platforms.
Cutscene: -cdf, --cutscene-dump-frames Dump frames when playing cutscenes. -ca, --cutscene-animation ARGPlay a specific animation in a cutscene after level load. -cn, --cutscene ARG Play cutscene immediately after level load.
Havok: -hdp, --havok-debugger-port ARGWhich port to use for the havok debugger.
Online: -join, --join ARG Gamertag to auto-join.
Misc: -4kf, --4k-fullscreen Forces 4K resolution and fullscreen in the window. -4kb, --4k-borderless Forces 4K resolution and borderless in the window. -perf, --perf Enable perf reporter for levels at a 1080p resolution. -perf4k, --perf4k Enable perf reporter for levels at a 4k resolution. -gpuWrite, --gpuWrite Enable writing GPU info to file on PC --- snip ---
Explicitly requesting DX11 Warp software renderer via '-warp' command line option:
--- snip --- $ wine ./CrashBandicootNSaneTrilogy.exe -warp ... 002e:fixme:win:EnumDisplayDevicesW ((null),0,0x23e6d0,0x00000000), stub! 002e:fixme:d3d11:D3D11CreateDevice WARP driver not implemented, falling back to hardware. 002e:fixme:dxgi:dxgi_factory_MakeWindowAssociation iface 0xc2fb90, window 0x10058, flags 0x2 stub! 005e:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering, Scaling and SwapEffect. 005e:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering, Scaling and SwapEffect. 002e:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 002e:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 002e:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 002e:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 002e:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 0056:fixme:d3d_shader:shader_sm4_read_instruction_modifier Unhandled modifier 0x800000c2. ... 0056:fixme:d3d_shader:shader_sm4_read_instruction_modifier Unhandled modifier 0x00155543. [Streaming] Loaded chunk 'shaders_win64:MP_PERMANENT' in 1179ms (load: 1179ms pending: 0ms) 0060:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 0060:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc39da0 stub! 002e:fixme:dxgi:dxgi_output_GetDisplayModeList iface 0x51bc20a0, format DXGI_FORMAT_R8G8B8A8_UNORM, flags 0, mode_count 0x23f950, desc (nil) partial stub! 002e:fixme:dxgi:dxgi_output_GetDisplayModeList iface 0x51bc20a0, format DXGI_FORMAT_R8G8B8A8_UNORM, flags 0, mode_count 0x23f950, desc 0x1de959d0 partial stub! 002e:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering, Scaling and SwapEffect. 002e:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering, Scaling and SwapEffect. 002e:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering, Scaling and SwapEffect. 005e:err:ntdll:RtlpWaitForCriticalSection section 0x7ff9534afbc0 "/home/focht/projects/wine/mainline-src/dlls/wined3d/wined3d_main.c: wined3d_cs" wait timed out in thread 005e, blocked by 002e, retrying (60 sec) --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=45430
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |6cad331f5019492c3e25953b7e2 | |477ec51bf088c Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
this was improved/fixed with commits:
* https://source.winehq.org/git/wine.git/commitdiff/f6484434cb68cfb497464f9df2... ("d3d10: Handle D3D10_DRIVER_TYPE_WARP in D3D10CreateDevice().") * https://source.winehq.org/git/wine.git/commitdiff/6cad331f5019492c3e25953b7e... "(d3d11: Handle D3D_DRIVER_TYPE_WARP in D3D11CreateDevice().")
Thanks Henri
--- snip --- $ pwd /home/focht/wine-games/wineprefix64-cb/drive_c/Program Files (x86)/Crash Bandicoot N Sane Trilogy
$ WINEDEBUG=-d3d_shader wine ./CrashBandicootNSaneTrilogy.exe -warp ... Setting breakpad minidump AppID = 265930 Steam_SetMinidumpSteamID: Caching Steam ID: 4294967296 [API loaded no] 002a:fixme:wtsapi:WTSRegisterSessionNotification Stub 0x10058 0x00000001 002a:fixme:win:EnumDisplayDevicesW ((null),0,0x23e7e0,0x00000000), stub! 002a:fixme:d3d11:D3D11CreateDevice WARP driver not implemented, falling back to hardware. 002a:fixme:dxgi:dxgi_factory_MakeWindowAssociation iface 0xc33120, window 0x10058, flags 0x2 stub! 005a:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering and Scaling. 005a:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering and Scaling. 002a:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 002a:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 002a:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 002a:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 002a:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! [Streaming] Loaded chunk 'shaders_win64:MP_PERMANENT' in 1025ms (load: 1025ms pending: 0ms) 005c:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 005c:fixme:d3d11:d3d11_immediate_context_Flush iface 0xc3d340 stub! 002a:fixme:dxgi:dxgi_output_GetDisplayModeList iface 0x50725bc0, format DXGI_FORMAT_R8G8B8A8_UNORM, flags 0, mode_count 0x23f950, desc (nil) partial stub! 002a:fixme:dxgi:dxgi_output_GetDisplayModeList iface 0x50725bc0, format DXGI_FORMAT_R8G8B8A8_UNORM, flags 0, mode_count 0x23f950, desc 0x1de959d0 partial stub! 002a:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering and Scaling. 002a:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering and Scaling. 002a:fixme:dxgi:d3d11_swapchain_GetDesc Ignoring ScanlineOrdering and Scaling. 005a:err:ntdll:RtlpWaitForCriticalSection section 0x7f20f2c15bc0 "/home/focht/projects/wine/mainline-src/dlls/wined3d/wined3d_main.c: wined3d_cs" wait timed out in thread 005a, blocked by 002a, retrying (60 sec) --- snip ---
The deadlock in 'IDXGISwapChain::ResizeTarget' is still there but that's covered by bug 45431
$ wine --version wine-3.15-188-g0799550075
Regards
https://bugs.winehq.org/show_bug.cgi?id=45430
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.16.