d3dcoder / d3d12book

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

Enter to Full Screen will crash #2

Open qzhan15 opened 8 years ago

discosultan commented 8 years ago

Just to provide some more insight, the DX debug layer shows the following errors for the crash:

DXGI ERROR: IDXGISwapChain::Present: The application has not called ResizeBuffers or re-created the SwapChain after a fullscreen or windowed transition. Flip model swapchains (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL and DXGI_SWAP_EFFECT_FLIP_DISCARD) are required to do so. [ MISCELLANEOUS ERROR #117: ]
D3D12 ERROR: ID3D12Resource::<final-release>: An ID3D12Resource object (0x00000224C9D9C660:'Unnamed ID3D12Resource Object') is being final-released before all GPU operations using the object have completed.  This is invalid and can result in application instability. [ EXECUTION ERROR #921: OBJECT_DELETED_WHILE_STILL_IN_USE]
D3D12 ERROR: ID3D12Resource::<final-release>: An ID3D12Resource object (0x00000224C9D18AA0:'Unnamed ID3D12Resource Object') is being final-released before all GPU operations using the object have completed.  This is invalid and can result in application instability. [ EXECUTION ERROR #921: OBJECT_DELETED_WHILE_STILL_IN_USE]
D3D12 ERROR: ID3D12DescriptorHeap::<final-release>: An ID3D12DescriptorHeap object (0x00000224C9D97BA0:'Unnamed ID3D12DescriptorHeap Object') is being final-released before all GPU operations using the object have completed.  This is invalid and can result in application instability. [ EXECUTION ERROR #921: OBJECT_DELETED_WHILE_STILL_IN_USE]
D3D12 ERROR: ID3D12RootSignature::<final-release>: An ID3D12RootSignature object (0x00000224C9D18710:'Unnamed ID3D12RootSignature Object') is being final-released before all GPU operations using the object have completed.  This is invalid and can result in application instability. [ EXECUTION ERROR #921: OBJECT_DELETED_WHILE_STILL_IN_USE]
DXGI ERROR: IDXGISwapChain::Release: Swapchain Released while fullscreen. Switch it to the windowed state first. [ MISCELLANEOUS ERROR #66: ]
hermestrimegistus commented 5 years ago

It doesnt crash for me. Can you post pstack?

Kamikaze1991 commented 3 years ago

hi, i resolve these crash.... in the method OnResize in d3dapp.cpp.... change SwapChainFlag to 0 in the buffer resize