summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-22 03:31:41 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-22 03:31:41 +0000
commit03a7b275d254f6db7267ff894aeebb58e2e6e72f (patch)
treef05b1a86581210a21b0fe42fed4f239b25412a55 /Tests/TestApp/src
parentUpdated readme (diff)
downloadDiligentEngine-03a7b275d254f6db7267ff894aeebb58e2e6e72f.tar.gz
DiligentEngine-03a7b275d254f6db7267ff894aeebb58e2e6e72f.zip
Added IFence interface
Diffstat (limited to 'Tests/TestApp/src')
-rw-r--r--Tests/TestApp/src/TestApp.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp
index 8c5062a..d9e81df 100644
--- a/Tests/TestApp/src/TestApp.cpp
+++ b/Tests/TestApp/src/TestApp.cpp
@@ -495,6 +495,12 @@ void TestApp::InitializeRenderers()
// This may cause D3D12 error
m_pImmediateContext->Flush();
}
+
+ {
+ FenceDesc fenceDesc;
+ fenceDesc.Name = "Test fence";
+ m_pDevice->CreateFence(fenceDesc, &m_pFence);
+ }
}
void TestApp::ProcessCommandLine(const char *CmdLine)
@@ -607,8 +613,15 @@ void TestApp::Render()
m_TestGS.Draw();
m_TestTessellation.Draw();
+ auto CompletedFenceValue = m_pFence->GetCompletedValue();
+ VERIFY_EXPR(CompletedFenceValue < m_NextFenceValue);
+ m_pImmediateContext->SignalFence(m_pFence, m_NextFenceValue++);
+
m_pImmediateContext->Flush();
m_pImmediateContext->InvalidateState();
+
+ CompletedFenceValue = m_pFence->GetCompletedValue();
+ VERIFY_EXPR(CompletedFenceValue < m_NextFenceValue);
}
void TestApp::Present()