summaryrefslogtreecommitdiffstats
path: root/unityplugin/GhostCubeScene/src
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-12-01 07:15:55 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-12-01 07:15:55 +0000
commit82d59de0d193554e1231b06347078d41ed8ec8d3 (patch)
treeb4d723394dd870f4e7a3201e3e804c88ff4aad7f /unityplugin/GhostCubeScene/src
parentUpdated submodules (added DRAW_FLAG_VERIFY_STATES & DISPATCH_FLAG_VERIFY_STAT... (diff)
downloadDiligentEngine-82d59de0d193554e1231b06347078d41ed8ec8d3.tar.gz
DiligentEngine-82d59de0d193554e1231b06347078d41ed8ec8d3.zip
Improved thread safety of enum flags; added explicit state transitions to SetRenderTargets()
Diffstat (limited to 'unityplugin/GhostCubeScene/src')
-rw-r--r--unityplugin/GhostCubeScene/src/GhostCubeScene.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
index e1f9937..b3762e6 100644
--- a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
+++ b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
@@ -156,7 +156,7 @@ void GhostCubeScene::Render(UnityRenderingEvent RenderEventFunc)
// In OpenGL, render targets must be bound to the pipeline to be cleared
ITextureView *pRTVs[] = { m_pRenderTarget->GetDefaultView(TEXTURE_VIEW_RENDER_TARGET) };
ITextureView *pDSV = m_pDepthBuffer->GetDefaultView(TEXTURE_VIEW_DEPTH_STENCIL);
- pCtx->SetRenderTargets(1, pRTVs, pDSV);
+ pCtx->SetRenderTargets(1, pRTVs, pDSV, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL);
const float ClearColor[] = { 0.f, 0.2f, 0.5f, 1.0f };
pCtx->ClearRenderTarget(pRTVs[0], ClearColor);
pCtx->ClearDepthStencil(pDSV, CLEAR_DEPTH_FLAG, ReverseZ ? 0.f : 1.f, 0);
@@ -193,7 +193,7 @@ void GhostCubeScene::Render(UnityRenderingEvent RenderEventFunc)
// We need to invalidate the context state since the plugin has used d3d11 context
pCtx->InvalidateState();
- pCtx->SetRenderTargets(0, nullptr, nullptr);
+ pCtx->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL);
pCtx->SetPipelineState(m_pMirrorPSO);
pCtx->CommitShaderResources(m_pMirrorSRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES);