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 --- .../GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'unityplugin/GhostCubePlugin/PluginSource') diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp index d37b42f..d51a670 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp @@ -48,13 +48,16 @@ public: return m_pUnityGraphicsD3D12->GetNextFrameFenceValue(); } - // Executes a given command list - virtual Uint64 DILIGENT_CALL_TYPE Submit(ID3D12GraphicsCommandList* commandList)override final + // Executes command lists + virtual Uint64 DILIGENT_CALL_TYPE Submit(Uint32 NumCommandLists, ID3D12CommandList* const* ppCommandLists)override final { auto NextFenceValue = m_pUnityGraphicsD3D12->GetNextFrameFenceValue(); - m_CurrentFenceValue = m_pUnityGraphicsD3D12->ExecuteCommandList(commandList, static_cast(m_ResourcesToTransition.size()), m_ResourcesToTransition.empty() ? nullptr : m_ResourcesToTransition.data()); - VERIFY(m_CurrentFenceValue >= NextFenceValue, "Current fence value returned by ExecuteCommandList() is less than the next fence value previously queried through GetNextFrameFenceValue()"); - m_ResourcesToTransition.clear(); + for(Uint32 i=0; i < NumCommandLists; ++i) + { + m_CurrentFenceValue = m_pUnityGraphicsD3D12->ExecuteCommandList(static_cast(ppCommandLists[i]), static_cast(m_ResourcesToTransition.size()), m_ResourcesToTransition.empty() ? nullptr : m_ResourcesToTransition.data()); + VERIFY(m_CurrentFenceValue >= NextFenceValue, "Current fence value returned by ExecuteCommandList() is less than the next fence value previously queried through GetNextFrameFenceValue()"); + m_ResourcesToTransition.clear(); + } return std::max(m_CurrentFenceValue, NextFenceValue); } -- cgit v1.2.3