summaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-08 02:37:03 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-02-08 02:37:03 +0000
commit93a08dc744daff2e7150bdf5775645d94567ace1 (patch)
treefdf6e39caf973cdaecb82ad37c1a0ccf55d887c6 /Projects
parentUpdated tools module (diff)
downloadDiligentEngine-93a08dc744daff2e7150bdf5775645d94567ace1.tar.gz
DiligentEngine-93a08dc744daff2e7150bdf5775645d94567ace1.zip
Reworked ExecuteCommandList(+s) to take an array of command lists instead of one
Diffstat (limited to 'Projects')
-rw-r--r--Projects/Asteroids/src/asteroids_DE.cpp6
-rw-r--r--Projects/Asteroids/src/asteroids_DE.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp
index 64fdc43..4e7a98c 100644
--- a/Projects/Asteroids/src/asteroids_DE.cpp
+++ b/Projects/Asteroids/src/asteroids_DE.cpp
@@ -1024,9 +1024,13 @@ void Asteroids::Render(float frameTime, const OrbitCamera& camera, const Setting
// Reset mRenderSubsetsSignal while all threads are waiting for mUpdateSubsetsSignal
mRenderSubsetsSignal.Reset();
+ mCmdListPtrs.resize(mCmdLists.size());
+ for(size_t i=0; i < mCmdLists.size(); ++i)
+ mCmdListPtrs[i] = mCmdLists[i];
+ mDeviceCtxt->ExecuteCommandLists(static_cast<Uint32>(mCmdListPtrs.size()), mCmdListPtrs.data());
+
for (auto& cmdList : mCmdLists)
{
- mDeviceCtxt->ExecuteCommandList(cmdList);
// Release command lists now to release all outstanding references
// In d3d11 mode, command lists hold references to the swap chain's back buffer
// that cause swap chain resize to fail
diff --git a/Projects/Asteroids/src/asteroids_DE.h b/Projects/Asteroids/src/asteroids_DE.h
index afa9d49..fe763d7 100644
--- a/Projects/Asteroids/src/asteroids_DE.h
+++ b/Projects/Asteroids/src/asteroids_DE.h
@@ -62,6 +62,7 @@ private:
Diligent::RefCntAutoPtr<Diligent::IDeviceContext> mDeviceCtxt;
std::vector< Diligent::RefCntAutoPtr<Diligent::IDeviceContext> > mDeferredCtxt;
std::vector< Diligent::RefCntAutoPtr<Diligent::ICommandList> > mCmdLists;
+ std::vector< Diligent::ICommandList* > mCmdListPtrs;
Diligent::Uint32 mBackBufferWidth, mBackBufferHeight;
Diligent::Uint32 mNumSubsets = 0;