summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-08-29 16:06:51 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-08-29 16:06:51 +0000
commit4c7a584a22a7a7a17494b26f616a34012c253ddd (patch)
tree899e628b39eb50c13110ed297b38acc5e50610a5 /Graphics/GraphicsEngineD3D12
parentBasic math: added double4x4, double3x3, and double2x2 matrix types (diff)
downloadDiligentCore-4c7a584a22a7a7a17494b26f616a34012c253ddd.tar.gz
DiligentCore-4c7a584a22a7a7a17494b26f616a34012c253ddd.zip
Added IDeviceContextD3D12::GetD3D12CommandList method
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h12
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp6
3 files changed, 20 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
index d22784dd..7674ed54 100644
--- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
@@ -158,6 +158,8 @@ public:
virtual void TransitionBufferState(IBuffer *pBuffer, D3D12_RESOURCE_STATES State)override final;
+ virtual ID3D12GraphicsCommandList* GetD3D12CommandList()override final;
+
///// Number of different shader types (Vertex, Pixel, Geometry, Domain, Hull, Compute)
//static constexpr int NumShaderTypes = 6;
diff --git a/Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h b/Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h
index 38e2d1a8..293815d9 100644
--- a/Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h
+++ b/Graphics/GraphicsEngineD3D12/interface/DeviceContextD3D12.h
@@ -51,6 +51,18 @@ public:
/// \param [in] pBuffer - Buffer to transition
/// \param [in] State - D3D12 resource state this buffer to transition to
virtual void TransitionBufferState(IBuffer* pBuffer, D3D12_RESOURCE_STATES State) = 0;
+
+ /// Returns a pointer to Direct3D12 graphics command list that is currently being recorded
+
+ /// \return - a pointer to the current command list
+ ///
+ /// \remarks Any command on the device context may potentially submit the command list for
+ /// execution into the command queue and make it invalid. An application should
+ /// never cache the pointer and should instead request the command list every time it
+ /// needs it.\n
+ /// The engine manages the lifetimes of all command buffers, so an application must
+ /// not call AddRef/Release methods on the returned interface.
+ virtual ID3D12GraphicsCommandList* GetD3D12CommandList() = 0;
};
}
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 3c1a4ca6..01aa8307 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -1629,4 +1629,10 @@ namespace Diligent
auto& CmdCtx = GetCmdContext();
CmdCtx.TransitionResource(ValidatedCast<IBufferD3D12>(pBuffer), D3D12ResourceStatesToResourceStateFlags(State));
}
+
+ ID3D12GraphicsCommandList* DeviceContextD3D12Impl::GetD3D12CommandList()
+ {
+ auto& CmdCtx = GetCmdContext();
+ return CmdCtx.GetCommandList();
+ }
}