From 000fdae6ccfe0067b8621400b3c92cab1d86cedc Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 4 Dec 2018 20:10:35 -0800 Subject: Minor code improvements in Vk backend --- .../src/DeviceContextD3D11Impl.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 01443e9d..60062210 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -1263,21 +1263,13 @@ namespace Diligent { for (Uint32 rt = 0; rt < NumRenderTargets; ++rt) { - auto* pView = m_pBoundRenderTargets[rt].RawPtr(); - if (pView) - { - auto* pViewD3D11 = ValidatedCast(pView); - pd3d11RTs[rt] = static_cast(pViewD3D11->GetD3D11View()); - } - else - pd3d11RTs[rt] = nullptr; + auto* pViewD3D11 = m_pBoundRenderTargets[rt].RawPtr(); + pd3d11RTs[rt] = pViewD3D11 != nullptr ? static_cast(pViewD3D11->GetD3D11View()) : nullptr; } - auto* pDepthStencil = m_pBoundDepthStencil.RawPtr(); - if (pDepthStencil != nullptr) + if (m_pBoundDepthStencil != nullptr) { - auto* pViewD3D11 = ValidatedCast(pDepthStencil); - pd3d11DSV = static_cast(pViewD3D11->GetD3D11View()); + pd3d11DSV = static_cast(m_pBoundDepthStencil->GetD3D11View()); } } @@ -1518,7 +1510,7 @@ namespace Diligent bool bCommitRenderTargets = false; for (Uint32 rt = 0; rt < m_NumBoundRenderTargets; ++rt) { - if (auto pTexView = m_pBoundRenderTargets[rt]) + if (auto* pTexView = m_pBoundRenderTargets[rt].RawPtr()) { if (pTexView->GetTexture() == pTexture) { @@ -2008,7 +2000,7 @@ namespace Diligent NumBoundRTVs = m_NumBoundRenderTargets; for (Uint32 rt = 0; rt < NumBoundRTVs; ++rt) { - if (auto pRT = m_pBoundRenderTargets[rt]) + if (auto* pRT = m_pBoundRenderTargets[rt].RawPtr()) BoundRTVFormats[rt] = pRT->GetDesc().Format; else BoundRTVFormats[rt] = TEX_FORMAT_UNKNOWN; -- cgit v1.2.3