Browse Source

Examples: DirectX12: Fixed shutdown issue. (#301)

omar 7 years ago
parent
commit
7e24ce0956
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/directx12_example/main.cpp

+ 2 - 2
examples/directx12_example/main.cpp

@@ -396,7 +396,7 @@ int main(int, char**)
         g_pd3dCommandList->ResourceBarrier(1, &barrier);
         g_pd3dCommandList->ResourceBarrier(1, &barrier);
         g_pd3dCommandList->Close();
         g_pd3dCommandList->Close();
 
 
-        g_pd3dCommandQueue->ExecuteCommandLists(1, (ID3D12CommandList* const*) &g_pd3dCommandList);
+        g_pd3dCommandQueue->ExecuteCommandLists(1, (ID3D12CommandList* const*)&g_pd3dCommandList);
 
 
         g_pSwapChain->Present(1, 0); // Present with vsync
         g_pSwapChain->Present(1, 0); // Present with vsync
         //g_pSwapChain->Present(0, 0); // Present without vsync
         //g_pSwapChain->Present(0, 0); // Present without vsync
@@ -407,9 +407,9 @@ int main(int, char**)
         frameCtxt->FenceValue = fenceValue;
         frameCtxt->FenceValue = fenceValue;
     }
     }
 
 
+    WaitForLastSubmittedFrame();
     ImGui_ImplDX12_Shutdown();
     ImGui_ImplDX12_Shutdown();
     ImGui::DestroyContext();
     ImGui::DestroyContext();
-
     CleanupDeviceD3D();
     CleanupDeviceD3D();
     UnregisterClass(_T("ImGui Example"), wc.hInstance);
     UnregisterClass(_T("ImGui Example"), wc.hInstance);