Browse Source

D3D11: Release frame buffer swap chain on shutdown.

Branimir Karadžić 10 years ago
parent
commit
1b6ef6dba3
2 changed files with 6 additions and 0 deletions
  1. 5 0
      src/renderer_d3d11.cpp
  2. 1 0
      src/renderer_d3d11.h

+ 5 - 0
src/renderer_d3d11.cpp

@@ -1453,6 +1453,11 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 
 
 			invalidateCache();
 			invalidateCache();
 
 
+			for (uint32_t ii = 0; ii < BX_COUNTOF(m_frameBuffers); ++ii)
+			{
+				m_frameBuffers[ii].destroy();
+			}
+
 			for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii)
 			for (uint32_t ii = 0; ii < BX_COUNTOF(m_indexBuffers); ++ii)
 			{
 			{
 				m_indexBuffers[ii].destroy();
 				m_indexBuffers[ii].destroy();

+ 1 - 0
src/renderer_d3d11.h

@@ -248,6 +248,7 @@ namespace bgfx { namespace d3d11
 	{
 	{
 		FrameBufferD3D11()
 		FrameBufferD3D11()
 			: m_dsv(NULL)
 			: m_dsv(NULL)
+			, m_swapChain(NULL)
 			, m_width(0)
 			, m_width(0)
 			, m_height(0)
 			, m_height(0)
 			, m_denseIdx(UINT16_MAX)
 			, m_denseIdx(UINT16_MAX)