summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp
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
parentUpdated readme (diff)
downloadDiligentEngine-03a7b275d254f6db7267ff894aeebb58e2e6e72f.tar.gz
DiligentEngine-03a7b275d254f6db7267ff894aeebb58e2e6e72f.zip
Added IFence interface
Diffstat (limited to 'Tests/TestApp')
-rw-r--r--Tests/TestApp/include/TestApp.h2
-rw-r--r--Tests/TestApp/src/TestApp.cpp13
2 files changed, 15 insertions, 0 deletions
diff --git a/Tests/TestApp/include/TestApp.h b/Tests/TestApp/include/TestApp.h
index 931007b..4c5ad53 100644
--- a/Tests/TestApp/include/TestApp.h
+++ b/Tests/TestApp/include/TestApp.h
@@ -87,6 +87,8 @@ protected:
Diligent::RefCntAutoPtr<Diligent::IBuffer> m_pInstBuff, m_pInstBuff2, m_pUniformBuff, m_pUniformBuff2, m_pUniformBuff3, m_pUniformBuff4;
Diligent::RefCntAutoPtr<Diligent::ITexture> m_pTestTex;
Diligent::RefCntAutoPtr<Diligent::ScriptParser> m_pRenderScript;
+ Diligent::RefCntAutoPtr<Diligent::IFence> m_pFence;
+ Diligent::Uint64 m_NextFenceValue = 1;
SmartPointerTest m_SmartPointerTest;
double m_CurrTime = 0;
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()