castorix / WinUI3_SwapChainPanel_Layered

43 stars 2 forks source link

The return value of D3D11CreateDevice is -2005270483 #6

Open penndai opened 2 weeks ago

penndai commented 2 weeks ago

Hi, when I tried to run locally, found the returned value from the D3D11CreateDevice, which is imported from D3D11.dll is not the expected GlobalStructures.HRESULT.S_OK, it is a large negative value -2005270483.

Is anyone had the same issue before? The version of the dll is : image

castorix commented 1 week ago

The hexa vaue is 0x887A002D From Google, this means that you don't have the DirectX SDK Layer package

You can remove the D3D11_CREATE_DEVICE_DEBUG flag or test in Release by adding :

if DEBUG

        creationFlags |= (uint)D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_DEBUG;

endif

Check answer from Chuck Walbourn (DirectX expert from MS) at https://stackoverflow.com/questions/44334207/d3d11createdevice-0x887a002d-error