From 6e300d8c6a0c2157b8d804cd604dad6079429d8d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 30 Mar 2018 09:59:44 -0700 Subject: Updated submodules; enabled fullscreen mode --- Projects/Asteroids/src/asteroids_DE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Projects/Asteroids/src/asteroids_DE.cpp') diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 296f05f..c27b6a1 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]); -- cgit v1.2.3 From ba7b40284d98e893d4e8119c65d1d89c6a7091cf Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 16:45:18 -0700 Subject: Added sync interval to Present. Fixed https://github.com/DiligentGraphics/DiligentEngine/issues/10 --- Projects/Asteroids/src/asteroids_DE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Projects/Asteroids/src/asteroids_DE.cpp') diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index c27b6a1..4d7501b 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -843,7 +843,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) -- cgit v1.2.3 From 81400ebf6c77c09ea12bbc532ea5658b3c09fc87 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 31 Mar 2018 22:39:38 -0700 Subject: Fixed issue with d3d11 swap chain faling to resize due to command lists not being released --- Projects/Asteroids/src/asteroids_DE.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Projects/Asteroids/src/asteroids_DE.cpp') diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 4d7501b..40d9db2 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -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(); } } -- cgit v1.2.3