From d708b5ea21bd607c79bde7f578707a62e40f1d4f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 8 Oct 2018 19:51:25 -0700 Subject: Fixed transitoin to fullscreen mode in D3D11 --- Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h | 3 +++ Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index 30f5c83f..6261837e 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -106,6 +106,9 @@ public: /// states. void ReleaseCommittedShaderResources(); + /// Unbinds all render targets. Used when resizing the swap chain. + void ResetRenderTargets(); + /// Number of different shader types (Vertex, Pixel, Geometry, Domain, Hull, Compute) static constexpr int NumShaderTypes = 6; diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index d848c5b0..da225356 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -1282,6 +1282,12 @@ namespace Diligent pTexD3D11->ClearState(D3D11TextureState::DepthStencil); } + void DeviceContextD3D11Impl::ResetRenderTargets() + { + TDeviceContextBase::ResetRenderTargets(); + m_pd3d11DeviceContext->OMSetRenderTargets(0, nullptr, nullptr); + } + void DeviceContextD3D11Impl::SetRenderTargets( Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil ) { if( TDeviceContextBase::SetRenderTargets( NumRenderTargets, ppRenderTargets, pDepthStencil ) ) -- cgit v1.2.3