From 17a8d2458d717567eae912aeb2c412ab4c3b2752 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 2 Jul 2018 08:43:54 -0700 Subject: Minor update to DeviceContextBase::SetRenderTargets() --- Graphics/GraphicsEngine/include/DeviceContextBase.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index e8e339db..a3889bbb 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -407,7 +407,10 @@ inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRend m_FramebufferSlices = 0; ITextureView* pDefaultRTV = nullptr; - if (NumRenderTargets == 0 && pDepthStencil == nullptr) + bool IsDefaultFrambuffer = NumRenderTargets == 0 && pDepthStencil == nullptr; + bBindRenderTargets = (m_IsDefaultFramebufferBound != IsDefaultFrambuffer); + m_IsDefaultFramebufferBound = IsDefaultFrambuffer; + if (m_IsDefaultFramebufferBound) { VERIFY(m_pSwapChain, "Swap chain is not initialized in the device context"); @@ -420,14 +423,7 @@ inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRend m_FramebufferWidth = SwapChainDesc.Width; m_FramebufferHeight = SwapChainDesc.Height; m_FramebufferSlices = 1; - - if (!m_IsDefaultFramebufferBound) - bBindRenderTargets = true; - m_IsDefaultFramebufferBound = true; } - else - m_IsDefaultFramebufferBound = false; - if( NumRenderTargets != m_NumBoundRenderTargets ) { -- cgit v1.2.3