diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-21 18:01:10 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-21 18:01:10 +0000 |
| commit | 41e5a5404dd18c748a8355c0796d5e53f793c3b9 (patch) | |
| tree | 58af8fabc3132d1edce8248ae5f5eaf53bbd6f42 /unityplugin/UnityEmulator | |
| parent | Fixed release history (diff) | |
| download | DiligentEngine-41e5a5404dd18c748a8355c0796d5e53f793c3b9.tar.gz DiligentEngine-41e5a5404dd18c748a8355c0796d5e53f793c3b9.zip | |
Implemented explicit resource state transitions
Diffstat (limited to 'unityplugin/UnityEmulator')
| -rw-r--r-- | unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp | 4 | ||||
| -rw-r--r-- | unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp index f804e90..13d91da 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D11.cpp @@ -66,7 +66,7 @@ public: RefCntAutoPtr<IRenderDeviceD3D11> pRenderDeviceD3D11(m_pRenderDevice, IID_RenderDeviceD3D11); RefCntAutoPtr<ITexture> pBackBuffer; - pRenderDeviceD3D11->CreateTextureFromD3DResource(pd3dTex2DBackBuffer, &pBackBuffer); + pRenderDeviceD3D11->CreateTextureFromD3DResource(pd3dTex2DBackBuffer, RESOURCE_STATE_UNDEFINED, &pBackBuffer); TextureViewDesc RTVDesc; RTVDesc.ViewType = TEXTURE_VIEW_RENDER_TARGET; RTVDesc.Format = m_SwapChainDesc.ColorBufferFormat; @@ -75,7 +75,7 @@ public: m_pRTV = RefCntAutoPtr<ITextureViewD3D11>(pRTV, IID_TextureViewD3D11); RefCntAutoPtr<ITexture> pDepthBuffer; - pRenderDeviceD3D11->CreateTextureFromD3DResource(pd3dTex2DDepthBuffer, &pDepthBuffer); + pRenderDeviceD3D11->CreateTextureFromD3DResource(pd3dTex2DDepthBuffer, RESOURCE_STATE_UNDEFINED, &pDepthBuffer); m_pDSV = RefCntAutoPtr<ITextureViewD3D11>(pDepthBuffer->GetDefaultView(TEXTURE_VIEW_DEPTH_STENCIL), IID_TextureViewD3D11); } diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp index 1ef8671..1ce1442 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp @@ -163,7 +163,7 @@ public: if(FAILED(hr)) LOG_ERROR_AND_THROW("Failed to get back buffer ", backbuff," from the swap chain"); RefCntAutoPtr<ITexture> pBackBuffer; - pRenderDeviceD3D12->CreateTextureFromD3DResource(pd3d12BackBuffer, &pBackBuffer); + pRenderDeviceD3D12->CreateTextureFromD3DResource(pd3d12BackBuffer, RESOURCE_STATE_UNDEFINED, &pBackBuffer); m_BackBuffers.emplace_back( RefCntAutoPtr<ITextureD3D12>(pBackBuffer, IID_TextureD3D12) ); TextureViewDesc TexViewDesc; TexViewDesc.ViewType = TEXTURE_VIEW_RENDER_TARGET; @@ -174,7 +174,7 @@ public: } RefCntAutoPtr<ITexture> pDepthBuffer; - pRenderDeviceD3D12->CreateTextureFromD3DResource(pd3d12DepthBuffer, &pDepthBuffer); + pRenderDeviceD3D12->CreateTextureFromD3DResource(pd3d12DepthBuffer, RESOURCE_STATE_UNDEFINED, &pDepthBuffer); m_DepthBuffer = RefCntAutoPtr<ITextureD3D12>(pDepthBuffer, IID_TextureD3D12); auto *pDSV = m_DepthBuffer->GetDefaultView(TEXTURE_VIEW_DEPTH_STENCIL); m_DSV = RefCntAutoPtr<ITextureViewD3D12>(pDSV, IID_TextureViewD3D12); |
