summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-07 20:50:39 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-02-07 20:50:39 +0000
commitc6c5bb5ed3d4e3296e6f65e4072db5cf8bf2452c (patch)
treee8848a7e01b2f576c11e9f9acfee6eca9fcdd681 /Graphics/GraphicsEngineD3D11
parentSwap chain Vk: improved presentation mode selection (fixed https://github.com... (diff)
downloadDiligentCore-c6c5bb5ed3d4e3296e6f65e4072db5cf8bf2452c.tar.gz
DiligentCore-c6c5bb5ed3d4e3296e6f65e4072db5cf8bf2452c.zip
Reworked ExecuteCommandList(s) to take multiple command lists instead of one
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp5
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp30
2 files changed, 22 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
index 74f5dd49..3c7bf09c 100644
--- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp
@@ -229,8 +229,9 @@ public:
/// Implementation of IDeviceContext::FinishCommandList() in Direct3D11 backend.
void DILIGENT_CALL_TYPE FinishCommandList(class ICommandList** ppCommandList) override final;
- /// Implementation of IDeviceContext::ExecuteCommandList() in Direct3D11 backend.
- virtual void DILIGENT_CALL_TYPE ExecuteCommandList(class ICommandList* pCommandList) override final;
+ /// Implementation of IDeviceContext::ExecuteCommandLists() in Direct3D11 backend.
+ virtual void DILIGENT_CALL_TYPE ExecuteCommandLists(Uint32 NumCommandLists,
+ ICommandList* const* ppCommandLists) override final;
/// Implementation of IDeviceContext::SignalFence() in Direct3D11 backend.
virtual void DILIGENT_CALL_TYPE SignalFence(IFence* pFence, Uint64 Value) override final;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index b4fa4c32..7c1ae564 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -1925,7 +1925,8 @@ void DeviceContextD3D11Impl::FinishCommandList(ICommandList** ppCommandList)
#endif
}
-void DeviceContextD3D11Impl::ExecuteCommandList(ICommandList* pCommandList)
+void DeviceContextD3D11Impl::ExecuteCommandLists(Uint32 NumCommandLists,
+ ICommandList* const* ppCommandLists)
{
if (m_bIsDeferred)
{
@@ -1933,16 +1934,23 @@ void DeviceContextD3D11Impl::ExecuteCommandList(ICommandList* pCommandList)
return;
}
- CommandListD3D11Impl* pCmdListD3D11 = ValidatedCast<CommandListD3D11Impl>(pCommandList);
- auto* pd3d11CmdList = pCmdListD3D11->GetD3D11CommandList();
- m_pd3d11DeviceContext->ExecuteCommandList(pd3d11CmdList,
- FALSE // A Boolean flag that determines whether the target context state is
- // saved prior to and restored after the execution of a command list.
- // * TRUE indicates that the runtime needs to save and restore the state.
- // * FALSE indicate that no state shall be saved or restored, which causes the
- // target context to return to its default state after the command list executes as if
- // ID3D11DeviceContext::ClearState() was called.
- );
+ if (NumCommandLists == 0)
+ return;
+ DEV_CHECK_ERR(ppCommandLists != nullptr, "ppCommandLists must not be null when NumCommandLists is not zero");
+
+ for (Uint32 i = 0; i < NumCommandLists; ++i)
+ {
+ auto* pCmdListD3D11 = ValidatedCast<CommandListD3D11Impl>(ppCommandLists[i]);
+ auto* pd3d11CmdList = pCmdListD3D11->GetD3D11CommandList();
+ m_pd3d11DeviceContext->ExecuteCommandList(pd3d11CmdList,
+ FALSE // A Boolean flag that determines whether the target context state is
+ // saved prior to and restored after the execution of a command list.
+ // * TRUE indicates that the runtime needs to save and restore the state.
+ // * FALSE indicate that no state shall be saved or restored, which causes the
+ // target context to return to its default state after the command list executes as if
+ // ID3D11DeviceContext::ClearState() was called.
+ );
+ }
// Device context is now in default state
InvalidateState();