summaryrefslogtreecommitdiffstats
path: root/unityplugin
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-04-21 03:03:35 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-04-21 03:03:35 +0000
commit12f29884f41303fe59502eee5789a4481fb1cffe (patch)
treea54a317efcd984b0723c066cd75a74d864550846 /unityplugin
parentFixed errors in blend state test on Vulkan (diff)
downloadDiligentEngine-12f29884f41303fe59502eee5789a4481fb1cffe.tar.gz
DiligentEngine-12f29884f41303fe59502eee5789a4481fb1cffe.zip
Few updates (restricted minimal window size on Win32, updated RawPtr() method, updated submodules)
Diffstat (limited to 'unityplugin')
-rw-r--r--unityplugin/GhostCubeScene/src/GhostCubeSceneResTrsnHelper.cpp4
-rw-r--r--unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp4
-rw-r--r--unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp14
-rw-r--r--unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp2
4 files changed, 12 insertions, 12 deletions
diff --git a/unityplugin/GhostCubeScene/src/GhostCubeSceneResTrsnHelper.cpp b/unityplugin/GhostCubeScene/src/GhostCubeSceneResTrsnHelper.cpp
index 39b89c1..4464cc0 100644
--- a/unityplugin/GhostCubeScene/src/GhostCubeSceneResTrsnHelper.cpp
+++ b/unityplugin/GhostCubeScene/src/GhostCubeSceneResTrsnHelper.cpp
@@ -42,8 +42,8 @@ void GhostCubeSceneResTrsnHelper::TransitionResources(int stateCount, UnityGraph
for (int i = 0; i < stateCount; ++i)
{
auto &ResState = states[i];
- ITextureD3D12 *pMirrorRT = ValidatedCast<ITextureD3D12>(m_TheScene.m_pRenderTarget.RawPtr());
- ITextureD3D12 *pMirrorDepth = ValidatedCast<ITextureD3D12>(m_TheScene.m_pDepthBuffer.RawPtr());
+ ITextureD3D12 *pMirrorRT = m_TheScene.m_pRenderTarget.RawPtr<ITextureD3D12>();
+ ITextureD3D12 *pMirrorDepth = m_TheScene.m_pDepthBuffer.RawPtr<ITextureD3D12>();
ITextureD3D12 *pResToTransition = nullptr;
if (ResState.resource == pMirrorRT->GetD3D12Texture())
pResToTransition = pMirrorRT;
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<ProxySwapChainD3D11>(m_pProxySwapChain.RawPtr())->SetSwapChainAttribs(pRTV, pDSV, Width, Height);
+ m_pProxySwapChain.RawPtr<ProxySwapChainD3D11>()->SetSwapChainAttribs(pRTV, pDSV, Width, Height);
}
void DiligentGraphicsAdapterD3D11::EndFrame()
{
- ValidatedCast<ProxySwapChainD3D11>(m_pProxySwapChain.RawPtr())->ResetSwapChainAttribs();
+ m_pProxySwapChain.RawPtr<ProxySwapChainD3D11>()->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<ProxySwapChainD3D12>(m_pProxySwapChain.RawPtr());
- auto *pDeviceD3D12 = ValidatedCast<IRenderDeviceD3D12>(m_pDevice.RawPtr());
+ auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr<ProxySwapChainD3D12>();
+ auto *pDeviceD3D12 = m_pDevice.RawPtr<IRenderDeviceD3D12>();
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<ProxySwapChainD3D12>(m_pProxySwapChain.RawPtr());
+ auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr<ProxySwapChainD3D12>();
pProxySwapChainD3D12->CreateBuffers(GraphicsImpl->GetDXGISwapChain(), GraphicsImpl->GetDepthBuffer());
}
void DiligentGraphicsAdapterD3D12::BeginFrame()
{
auto *GraphicsImpl = m_UnityGraphicsD3D12.GetGraphicsImpl();
- auto *pProxySwapChainD3D12 = ValidatedCast<ProxySwapChainD3D12>(m_pProxySwapChain.RawPtr());
+ auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr<ProxySwapChainD3D12>();
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<IDeviceContextD3D12>(m_pDeviceCtx.RawPtr());
- auto *pProxySwapChainD3D12 = ValidatedCast<ProxySwapChainD3D12>(m_pProxySwapChain.RawPtr());
+ auto *pCtxD3D12 = m_pDeviceCtx.RawPtr<IDeviceContextD3D12>();
+ auto *pProxySwapChainD3D12 = m_pProxySwapChain.RawPtr<ProxySwapChainD3D12>();
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<IRenderDeviceD3D12>(m_pDevice.RawPtr())->FinishFrame();
+ m_pDevice.RawPtr<IRenderDeviceD3D12>()->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<ProxySwapChainGL>(m_pProxySwapChain.RawPtr())->Resize(Width, Height);
+ m_pProxySwapChain.RawPtr<ProxySwapChainGL>()->Resize(Width, Height);
}
void DiligentGraphicsAdapterGL::EndFrame()