d3dcoder / d3d12book

Sample code for the book "Introduction to 3D Game Programming with DirectX 12"
1.53k stars 590 forks source link

Mysterious crash when initializing Direct3D, in CreateSwapChain #35

Open rnikander opened 1 year ago

rnikander commented 1 year ago

I was running the sample code fine on an Microsoft Surface. Then I went to my laptop (an ASUS Zenbook), and the programs crash at this line, with an error message I don't understand at all. Any ideas?

This is Chapter 4, Init Direct3D

d3dApp.cpp

ThrowIfFailed(mdxgiFactory->CreateSwapChain(
              mCommandQueue.Get(),
              &sd, 
              mSwapChain.GetAddressOf()));

The error message:

Exception thrown at 0x00007FFAF02AB3A7 (d3d12SDKLayers.dll) in Init Direct3D.exe: 0xC0000005: 
Access violation reading location 0x0000000000000000.
Zakgard commented 2 weeks ago

Same issue...did you fix?

rnikander commented 2 weeks ago

Sorry, can't remember. I ended up giving up D3D and going to Vulkan. Not that it's any easier. But given how difficult these APIs are I wanted my efforts to be more cross-platform.