5 #include <tbb/concurrent_queue.h> 8 #include <Utils\DebugUtils.h> 25 static void Create(
const std::uint32_t maxNumberOfCommandListsToExecute) noexcept;
38 __forceinline
bool AreTherePendingCommandListsToExecute()
const noexcept
40 return mCommandListsToExecute.empty() && mPendingCommandListCount == 0;
48 __forceinline
void ResetExecutedCommandListCount() noexcept
50 mExecutedCommandListCount = 0U;
52 __forceinline std::uint32_t GetExecutedCommandListCount()
const noexcept
54 return mExecutedCommandListCount;
57 __forceinline
void AddCommandList(ID3D12CommandList& commandList) noexcept
59 mCommandListsToExecute.push(&commandList);
62 __forceinline ID3D12CommandQueue& GetCommandQueue() noexcept
64 BRE_ASSERT(mCommandQueue !=
nullptr);
65 return *mCommandQueue;
68 void SignalFenceAndWaitForCompletion(ID3D12Fence& fence,
69 const std::uint64_t valueToSignal,
70 const std::uint64_t valueToWaitFor) noexcept;
72 void ExecuteCommandListAndWaitForCompletion(ID3D12CommandList& cmdList) noexcept;
74 void Terminate() noexcept;
80 tbb::task* execute()
final override;
84 bool mTerminate{
false };
86 std::uint32_t mExecutedCommandListCount{ 0U };
87 std::atomic<std::uint32_t> mPendingCommandListCount{ 0U };
88 std::uint32_t mMaxNumberOfCommandListsToExecute{ 1U };
90 ID3D12CommandQueue* mCommandQueue{
nullptr };
92 ID3D12Fence* mFence{
nullptr };
A high-performance thread-safe non-blocking concurrent queue.
Definition: concurrent_queue.h:35
Definition: CommandListExecutor.h:18