|
|
@@ -1594,6 +1594,10 @@ namespace bgfx { namespace d3d11
|
|
|
DX_RELEASE(m_annotation, 1);
|
|
|
DX_RELEASE_W(m_infoQueue, 0);
|
|
|
DX_RELEASE(m_msaaRt, 0);
|
|
|
+#if BX_PLATFORM_WINRT
|
|
|
+ // Remove swap chain from SwapChainPanel (nwh) if applicable
|
|
|
+ m_dxgi.removeSwapChain(m_scd, &m_swapChain);
|
|
|
+#endif
|
|
|
DX_RELEASE(m_swapChain, 0);
|
|
|
DX_RELEASE(m_deviceCtx, 0);
|
|
|
DX_RELEASE(m_device, 0);
|
|
|
@@ -1681,6 +1685,10 @@ namespace bgfx { namespace d3d11
|
|
|
DX_RELEASE(m_annotation, 1);
|
|
|
DX_RELEASE_W(m_infoQueue, 0);
|
|
|
DX_RELEASE(m_msaaRt, 0);
|
|
|
+#if BX_PLATFORM_WINRT
|
|
|
+ // Remove swap chain from SwapChainPanel (nwh) if applicable
|
|
|
+ m_dxgi.removeSwapChain(m_scd, &m_swapChain);
|
|
|
+#endif
|
|
|
DX_RELEASE(m_swapChain, 0);
|
|
|
DX_RELEASE(m_deviceCtx, 0);
|
|
|
DX_RELEASE(m_device, 0);
|
|
|
@@ -2351,6 +2359,22 @@ namespace bgfx { namespace d3d11
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ void updateNativeWindow()
|
|
|
+ {
|
|
|
+#if BX_PLATFORM_WINRT
|
|
|
+ // SwapChainPanels can be dynamically updated
|
|
|
+ if (m_scd.ndt == reinterpret_cast<void*>(2)
|
|
|
+ && (m_scd.nwh != g_platformData.nwh || m_scd.ndt != g_platformData.ndt))
|
|
|
+ {
|
|
|
+ // Remove swap chain from SwapChainPanel (nwh) if applicable
|
|
|
+ m_dxgi.removeSwapChain(m_scd, &m_swapChain);
|
|
|
+ // Update nwh after removing swap chain
|
|
|
+ m_scd.nwh = g_platformData.nwh;
|
|
|
+ m_scd.ndt = g_platformData.ndt;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ }
|
|
|
+
|
|
|
bool updateResolution(const Resolution& _resolution)
|
|
|
{
|
|
|
const bool suspended = !!( _resolution.reset & BGFX_RESET_SUSPEND);
|
|
|
@@ -2456,8 +2480,11 @@ namespace bgfx { namespace d3d11
|
|
|
updateMsaa(m_scd.format);
|
|
|
m_scd.sampleDesc = s_msaa[(m_resolution.reset&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT];
|
|
|
|
|
|
+#if BX_PLATFORM_WINRT
|
|
|
+ // Remove swap chain from SwapChainPanel (nwh) if applicable
|
|
|
+ m_dxgi.removeSwapChain(m_scd, &m_swapChain);
|
|
|
+#endif
|
|
|
DX_RELEASE(m_swapChain, 0);
|
|
|
-
|
|
|
HRESULT hr = m_dxgi.createSwapChain(m_device
|
|
|
, m_scd
|
|
|
, &m_swapChain
|
|
|
@@ -5483,8 +5510,13 @@ namespace bgfx { namespace d3d11
|
|
|
|
|
|
void RendererContextD3D11::submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter)
|
|
|
{
|
|
|
- if (m_lost
|
|
|
- || updateResolution(_render->m_resolution) )
|
|
|
+ if (m_lost)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ updateNativeWindow();
|
|
|
+ if (updateResolution(_render->m_resolution) )
|
|
|
{
|
|
|
return;
|
|
|
}
|