From 93a08dc744daff2e7150bdf5775645d94567ace1 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 7 Feb 2021 18:37:03 -0800 Subject: Reworked ExecuteCommandList(+s) to take an array of command lists instead of one --- Projects/Asteroids/src/asteroids_DE.cpp | 6 +++++- Projects/Asteroids/src/asteroids_DE.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Projects') 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(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 mDeviceCtxt; std::vector< Diligent::RefCntAutoPtr > mDeferredCtxt; std::vector< Diligent::RefCntAutoPtr > mCmdLists; + std::vector< Diligent::ICommandList* > mCmdListPtrs; Diligent::Uint32 mBackBufferWidth, mBackBufferHeight; Diligent::Uint32 mNumSubsets = 0; -- cgit v1.2.3