diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-04-01 22:02:39 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-04-01 22:02:39 +0000 |
| commit | 6badd197cd08a6e83fe907ffb00077aa99ea4e00 (patch) | |
| tree | a5987e5b8e54a3afed38ca144c43eca1fb896eb4 /Projects/Asteroids/src/asteroids_DE.cpp | |
| parent | Updated core (diff) | |
| parent | Updated readme (diff) | |
| download | DiligentEngine-6badd197cd08a6e83fe907ffb00077aa99ea4e00.tar.gz DiligentEngine-6badd197cd08a6e83fe907ffb00077aa99ea4e00.zip | |
Merged master
Diffstat (limited to 'Projects/Asteroids/src/asteroids_DE.cpp')
| -rw-r--r-- | Projects/Asteroids/src/asteroids_DE.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 296f05f..40d9db2 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -75,7 +75,7 @@ void Asteroids::InitDevice(HWND hWnd, DeviceType DevType) #endif auto *pFactoryD3D11 = GetEngineFactoryD3D11(); pFactoryD3D11->CreateDeviceAndContextsD3D11( DeviceAttribs, &mDevice, ppContexts.data(), mNumSubsets-1 ); - pFactoryD3D11->CreateSwapChainD3D11( mDevice, ppContexts[0], SwapChainDesc, hWnd, &mSwapChain ); + pFactoryD3D11->CreateSwapChainD3D11( mDevice, ppContexts[0], SwapChainDesc, FullScreenModeDesc{}, hWnd, &mSwapChain ); } else { @@ -92,7 +92,7 @@ void Asteroids::InitDevice(HWND hWnd, DeviceType DevType) #endif auto *pFactoryD3D12 = GetEngineFactoryD3D12(); pFactoryD3D12->CreateDeviceAndContextsD3D12( Attribs, &mDevice, ppContexts.data(), mNumSubsets-1 ); - pFactoryD3D12->CreateSwapChainD3D12( mDevice, ppContexts[0], SwapChainDesc, hWnd, &mSwapChain ); + pFactoryD3D12->CreateSwapChainD3D12( mDevice, ppContexts[0], SwapChainDesc, FullScreenModeDesc{}, hWnd, &mSwapChain ); } mDeviceCtxt.Attach(ppContexts[0]); @@ -769,6 +769,10 @@ void Asteroids::Render(float frameTime, const OrbitCamera& camera, const Setting for(auto &cmdList : mCmdLists) { mDeviceCtxt->ExecuteCommandList(cmdList); + // Release command lists now to release all outstanding references + // In d3d11 mode, command lists hold references to the swap chain's back buffer + // that cause swap chain resize to fail + cmdList.Release(); } } @@ -843,7 +847,7 @@ void Asteroids::Render(float frameTime, const OrbitCamera& camera, const Setting } } - mSwapChain->Present();//settings.vsync ? 1 : 0, 0); + mSwapChain->Present(settings.vsync ? 1 : 0); } void Asteroids::GetPerfCounters(float &UpdateTime, float &RenderTime) |
