From 12f29884f41303fe59502eee5789a4481fb1cffe Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 20 Apr 2018 20:03:35 -0700 Subject: Few updates (restricted minimal window size on Win32, updated RawPtr() method, updated submodules) --- .../UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp | 4 ++-- .../UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp | 14 +++++++------- .../UnityEmulator/src/DiligentGraphicsAdapterGL.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'unityplugin/UnityEmulator') diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp index c3f0f1c..ab5af8b 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp @@ -122,12 +122,12 @@ void DiligentGraphicsAdapterD3D11::BeginFrame() auto Width = UnityGraphicsD3D11Impl->GetBackBufferWidth(); auto Height = UnityGraphicsD3D11Impl->GetBackBufferHeight(); VERIFY_EXPR(pRTV != nullptr && pDSV != nullptr && Width != 0 && Height != 0); - ValidatedCast(m_pProxySwapChain.RawPtr())->SetSwapChainAttribs(pRTV, pDSV, Width, Height); + m_pProxySwapChain.RawPtr()->SetSwapChainAttribs(pRTV, pDSV, Width, Height); } void DiligentGraphicsAdapterD3D11::EndFrame() { - ValidatedCast(m_pProxySwapChain.RawPtr())->ResetSwapChainAttribs(); + m_pProxySwapChain.RawPtr()->ResetSwapChainAttribs(); m_pDeviceCtx->InvalidateState(); } diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp index 938d5b1..df5e6a9 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp @@ -214,8 +214,8 @@ void DiligentGraphicsAdapterD3D12::InitProxySwapChain() void DiligentGraphicsAdapterD3D12::PreSwapChainResize() { - auto *pProxySwapChainD3D12 = ValidatedCast(m_pProxySwapChain.RawPtr()); - auto *pDeviceD3D12 = ValidatedCast(m_pDevice.RawPtr()); + auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr(); + auto *pDeviceD3D12 = m_pDevice.RawPtr(); pProxySwapChainD3D12->ReleaseBuffers(); auto *GraphicsImpl = m_UnityGraphicsD3D12.GetGraphicsImpl(); pDeviceD3D12->FinishFrame(); @@ -228,14 +228,14 @@ void DiligentGraphicsAdapterD3D12::PreSwapChainResize() void DiligentGraphicsAdapterD3D12::PostSwapChainResize() { auto *GraphicsImpl = m_UnityGraphicsD3D12.GetGraphicsImpl(); - auto *pProxySwapChainD3D12 = ValidatedCast(m_pProxySwapChain.RawPtr()); + auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr(); pProxySwapChainD3D12->CreateBuffers(GraphicsImpl->GetDXGISwapChain(), GraphicsImpl->GetDepthBuffer()); } void DiligentGraphicsAdapterD3D12::BeginFrame() { auto *GraphicsImpl = m_UnityGraphicsD3D12.GetGraphicsImpl(); - auto *pProxySwapChainD3D12 = ValidatedCast(m_pProxySwapChain.RawPtr()); + auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr(); pProxySwapChainD3D12->SetBackBufferIndex(GraphicsImpl->GetCurrentBackBufferIndex()); // Unity graphics emulator transitions render target to D3D12_RESOURCE_STATE_RENDER_TARGET, // and depth buffer to D3D12_RESOURCE_STATE_DEPTH_WRITE state @@ -247,15 +247,15 @@ void DiligentGraphicsAdapterD3D12::EndFrame() { // Unity graphics emulator expects render target to be D3D12_RESOURCE_STATE_RENDER_TARGET, // and depth buffer to be in D3D12_RESOURCE_STATE_DEPTH_WRITE state - auto *pCtxD3D12 = ValidatedCast(m_pDeviceCtx.RawPtr()); - auto *pProxySwapChainD3D12 = ValidatedCast(m_pProxySwapChain.RawPtr()); + auto *pCtxD3D12 = m_pDeviceCtx.RawPtr(); + auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr(); auto *pCurrentBackBuffer = pProxySwapChainD3D12->GetCurrentBackBuffer(); auto *pDepthBuffer = pProxySwapChainD3D12->GetDepthBuffer(); pCtxD3D12->TransitionTextureState(pCurrentBackBuffer, D3D12_RESOURCE_STATE_RENDER_TARGET); pCtxD3D12->TransitionTextureState(pDepthBuffer, D3D12_RESOURCE_STATE_DEPTH_WRITE); m_pDeviceCtx->Flush(); m_pDeviceCtx->InvalidateState(); - ValidatedCast(m_pDevice.RawPtr())->FinishFrame(); + m_pDevice.RawPtr()->FinishFrame(); } bool DiligentGraphicsAdapterD3D12::UsesReverseZ() diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp index 8be2797..c84ff8b 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp @@ -109,7 +109,7 @@ void DiligentGraphicsAdapterGL::BeginFrame() auto *UnityGraphicsGLImpl = m_UnityGraphicsGL.GetGraphicsImpl(); Uint32 Width = UnityGraphicsGLImpl->GetBackBufferWidth(); Uint32 Height = UnityGraphicsGLImpl->GetBackBufferHeight(); - ValidatedCast(m_pProxySwapChain.RawPtr())->Resize(Width, Height); + m_pProxySwapChain.RawPtr()->Resize(Width, Height); } void DiligentGraphicsAdapterGL::EndFrame() -- cgit v1.2.3