From 920a85a4cf1ac46061f784233a43d90d207c9f69 Mon Sep 17 00:00:00 2001 From: Mikulas Florek Date: Thu, 6 Aug 2015 23:02:43 +0200 Subject: [PATCH] d3d9 framebuffer correctly handles bgfx::reset --- src/renderer_d3d9.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index a61feef7..39a1e4b3 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -2921,6 +2921,7 @@ namespace bgfx { namespace d3d9 { DX_RELEASE(m_color[0], 0); DX_RELEASE(m_swapChain, 0); + DX_RELEASE(m_depthStencil, 0); } else { @@ -2950,6 +2951,16 @@ namespace bgfx { namespace d3d9 { DX_CHECK(s_renderD3D9->m_device->CreateAdditionalSwapChain(&s_renderD3D9->m_params, &m_swapChain) ); DX_CHECK(m_swapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &m_color[0]) ); + DX_CHECK(s_renderD3D9->m_device->CreateDepthStencilSurface( + s_renderD3D9->m_params.BackBufferWidth + , s_renderD3D9->m_params.BackBufferHeight + , s_renderD3D9->m_params.AutoDepthStencilFormat + , s_renderD3D9->m_params.MultiSampleType + , s_renderD3D9->m_params.MultiSampleQuality + , FALSE + , &m_depthStencil + , NULL + )); } else {