D3D12: Cleanup/refactoring of teardown process

This commit is contained in:
Stenzek
2016-02-17 14:57:57 +10:00
parent 759b77474d
commit 649b94338e
5 changed files with 57 additions and 77 deletions

View File

@ -715,7 +715,7 @@ void CreateRootSignatures()
void WaitForOutstandingRenderingToComplete()
{
command_list_mgr->ClearQueueAndWaitForCompletionOfInflightWork();
command_list_mgr->ExecuteQueuedWork(true);
}
void Close()
@ -731,8 +731,6 @@ void Close()
D3D::CleanupPersistentD3DTextureResources();
command_list_mgr->ImmediatelyDestroyAllResourcesScheduledForDestruction();
SAFE_RELEASE(s_swap_chain);
command_list_mgr.reset();
@ -816,15 +814,15 @@ unsigned int GetMaxTextureSize()
void Reset()
{
command_list_mgr->ExecuteQueuedWork(true);
// release all back buffer references
for (UINT i = 0; i < ARRAYSIZE(s_backbuf); i++)
{
SAFE_RELEASE(s_backbuf[i]);
}
D3D::command_list_mgr->ImmediatelyDestroyAllResourcesScheduledForDestruction();
// Block until all commands have finished.
// This will also final-release all pending resources (including the backbuffer above)
command_list_mgr->ExecuteQueuedWork(true);
// resize swapchain buffers
RECT client;