libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.96k stars 1.84k forks source link

SDL GPU D3D12: Vertex shader root signature mismatch in Windows 10 VM #11458

Closed zturtleman closed 1 day ago

zturtleman commented 1 day ago

Running testgpu_spinning_cube in a Windows 10 VM (with the default D3D12 driver) fails and exits immediately due to an uncaught exception. Running testgpu_simple_clear works.

This happens in builds by both MSYS2/mingw-w64 and Visual Studio 2022. The host is Debian 12 running virt-manager.

The last line run in SDL: https://github.com/libsdl-org/SDL/blob/5a74aadac946d4296570d630ee0607e4681d3f8c/src/gpu/d3d12/SDL_gpu_d3d12.c#L2832

gdb log from MSYS2/mingw-w64 build:

$ gdb ./test/testgpu_spinning_cube.exe
[New Thread 9416.0x2290]
[New Thread 9416.0x2674]
[New Thread 9416.0x1a94]
[New Thread 9416.0x26e4]
[New Thread 9416.0x2454]
[New Thread 9416.0x1174]
warning: Screen bpp: 24
Screen bpp: 24
warning: onecore\windows\directx\dxcore\dll\dxcore.cpp(350)\dxcore.dll!00007FF852299528: (caller: 00
007FF8466BB3C6) Exception(1) tid(1c18) 887A0004 The specified device interface or feature level is n
ot supported on this system.
warning: onecore\windows\directx\dxcore\dll\dxcore.cpp(350)\dxcore.dll!00007FF852299528: (caller: 00
007FF8466BB3C6) Exception(1) tid(1c18) 887A0004 The specified device interface or feature level is n
ot supported on this system.
[New Thread 9416.0x868]
[New Thread 9416.0x9d8]
warning: D3D12 ERROR: ID3D12Device::CreateGraphicsPipelineState: Root Signature doesn't match Vertex
 Shader: Shader CBV descriptor range (BaseShaderRegister=0, NumDescriptors=1, RegisterSpace=0) is no
t fully bound in root signature
 [ STATE_CREATION ERROR #688: CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH]
warning: D3D12: **BREAK** enabled for the previous message, which was: [ ERROR STATE_CREATION #688:
CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH ]
gdb: unknown target exception 0x0000087a at 0x7ff861feb699

Thread 1 received signal ?, Unknown signal.
0x00007ff861feb699 in RaiseException () from C:\Windows\System32\KernelBase.dll
(gdb) bt
#0  0x00007ff861feb699 in RaiseException () from C:\Windows\System32\KernelBase.dll
#1  0x00007ff854b83563 in dxgidebug!DXGI_SDK_MESSAGE () from C:\Windows\SYSTEM32\DXGIDebug.dll
#2  0x00007ff8391a2549 in d3dSDKLayers!D3D12TranslateCreateDevice ()
   from C:\Windows\SYSTEM32\d3d12SDKLayers.dll
#3  0x00007ff8390e3081 in d3dSDKLayers!D3D12TranslateCreateDevice ()
   from C:\Windows\SYSTEM32\d3d12SDKLayers.dll
#4  0x00007ff8390e2f4b in d3dSDKLayers!D3D12TranslateCreateDevice ()
   from C:\Windows\SYSTEM32\d3d12SDKLayers.dll
#5  0x00007ff8390eb472 in d3dSDKLayers!D3D12TranslateCreateDevice ()
   from C:\Windows\SYSTEM32\d3d12SDKLayers.dll
#6  0x00007ff8466e5355 in d3d12core!D3D12GetInterface () from C:\Windows\SYSTEM32\D3D12Core.dll
#7  0x00007ff8466d4456 in d3d12core!D3D12GetInterface () from C:\Windows\SYSTEM32\D3D12Core.dll
#8  0x00007ff8466f2e53 in d3d12core!D3D12GetInterface () from C:\Windows\SYSTEM32\D3D12Core.dll
#9  0x00007ff8466e4a73 in d3d12core!D3D12GetInterface () from C:\Windows\SYSTEM32\D3D12Core.dll
#10 0x00007ff8390ecd28 in d3dSDKLayers!D3D12TranslateCreateDevice ()
   from C:\Windows\SYSTEM32\d3d12SDKLayers.dll
#11 0x00007ff839ccc236 in D3D12_CreateGraphicsPipeline (driverData=0x414bb30, createinfo=0x5ffc00)
    at C:/Users/admin/Desktop/SDL/src/gpu/d3d12/SDL_gpu_d3d12.c:2832
#12 0x00007ff839a8bc57 in SDL_CreateGPUGraphicsPipeline_REAL (device=0x4155f50,
    graphicsPipelineCreateInfo=0x5ffc00) at C:/Users/admin/Desktop/SDL/src/gpu/SDL_gpu.c:860
#13 0x00007ff839a667d0 in SDL_CreateGPUGraphicsPipeline (a=0x4155f50, b=0x5ffc00)
    at C:/Users/admin/Desktop/SDL/src/dynapi/SDL_dynapi_procs.h:135
#14 0x00007ff7c3b52bd5 in init_render_state (msaa=0)
    at C:/Users/admin/Desktop/SDL/test/testgpu_spinning_cube.c:637
#15 0x00007ff7c3b5305c in SDL_main (argc=1, argv=0x77ee60)
    at C:/Users/admin/Desktop/SDL/test/testgpu_spinning_cube.c:738
#16 0x00007ff839c69eb2 in SDL_RunApp_REAL (_argc=0, _argv=0x0,
    mainFunction=0x7ff7c3b52eb8 <SDL_main>, reserved=0x0)
    at C:/Users/admin/Desktop/SDL/src/main/windows/SDL_sysmain_runapp.c:88
#17 0x00007ff839a5ff4b in SDL_RunApp_DEFAULT (a=0, b=0x0, c=0x7ff7c3b52eb8 <SDL_main>, d=0x0)
    at C:/Users/admin/Desktop/SDL/src/dynapi/SDL_dynapi_procs.h:804
#18 0x00007ff839a6cf74 in SDL_RunApp (a=0, b=0x0, c=0x7ff7c3b52eb8 <SDL_main>, d=0x0)
    at C:/Users/admin/Desktop/SDL/src/dynapi/SDL_dynapi_procs.h:804
#19 0x00007ff7c3b51484 in WinMain (hInst=0x7ff7c3b50000, hPrev=0x0, szCmdLine=0x7747f2 "", sw=10)
    at C:/Users/admin/Desktop/SDL/include/SDL3/SDL_main_impl.h:125
#20 0x00007ff7c3b5fc51 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
    at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexewin.c:67
#21 0x00007ff7c3b512ee in __tmainCRTStartup ()
    at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:267
#22 0x00007ff7c3b51406 in mainCRTStartup () at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:188

dxdiag with feature levels: Screenshot from 2024-11-12 19-04-45

thatcosmonaut commented 1 day ago

Should be fixed by https://github.com/libsdl-org/SDL/commit/a85f0b49f4a9fa610e5c2a6e14577da9231c8f89

zturtleman commented 1 day ago

It works now, thank you.