summaryrefslogtreecommitdiffstats
path: root/Projects/Asteroids/src/asteroids_DE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/Asteroids/src/asteroids_DE.cpp')
-rw-r--r--Projects/Asteroids/src/asteroids_DE.cpp10
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)