summaryrefslogtreecommitdiffstats
path: root/Projects/Asteroids/src/asteroids_DE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/Asteroids/src/asteroids_DE.cpp')
-rw-r--r--Projects/Asteroids/src/asteroids_DE.cpp7
1 files changed, 6 insertions, 1 deletions
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;