From 39301f3ff366f46074911662158d3c0697d58bec Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 30 Jul 2018 21:03:00 -0700 Subject: Updated asteroids demo to call FinishFrame on deferred contexts; updated core & samples submodules --- Projects/Asteroids/src/asteroids_DE.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Projects/Asteroids/src/asteroids_DE.cpp') diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 0ac1b3c..033106c 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -666,7 +666,6 @@ void Asteroids::WorkerThreadFunc(Asteroids *pThis, Diligent::Uint32 ThreadNum) // Increment number of completed threads ++pThis->m_NumThreadsCompleted; } - } void Asteroids::RenderSubset(Diligent::Uint32 SubsetNum, @@ -804,6 +803,12 @@ void Asteroids::Render(float frameTime, const OrbitCamera& camera, const Setting } } + // Call FinishFrame() to release dynamic resources allocated by deferred contexts + // IMPORTANT: we must wait until the command lists are submitted for execution + // because FinishFrame() invalidates all dynamic resources + for(auto& ctx : mDeferredCtxt) + ctx->FinishFrame(); + QueryPerformanceCounter((LARGE_INTEGER*)&currCounter); mRenderTicks = currCounter-mRenderTicks; -- cgit v1.2.3