summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-08-19 16:04:49 +0000
committerazhirnov <zh1dron@gmail.com>2020-08-19 16:04:49 +0000
commit24598081aa13231ab80bf7e62476855bf4e177cd (patch)
tree3f7d8b7324f5390014dbb9d518f63ad42bd0c4d3 /Graphics/GraphicsEngineD3D12
parentCache pointers to ID3D12GraphicsCommandList6 and ID3D12Device2 (diff)
downloadDiligentCore-24598081aa13231ab80bf7e62476855bf4e177cd.tar.gz
DiligentCore-24598081aa13231ab80bf7e62476855bf4e177cd.zip
Added root signature for DrawMeshIndirect, added some checks
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index e6e24fa0..19c02a0d 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -119,6 +119,13 @@ DeviceContextD3D12Impl::DeviceContextD3D12Impl(IReferenceCounters* pRef
IndirectArg.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH;
hr = pd3d12Device->CreateCommandSignature(&CmdSignatureDesc, nullptr, __uuidof(m_pDispatchIndirectSignature), reinterpret_cast<void**>(static_cast<ID3D12CommandSignature**>(&m_pDispatchIndirectSignature)));
CHECK_D3D_RESULT_THROW(hr, "Failed to create dispatch indirect command signature");
+
+#ifdef D12_H_HAS_MESH_SHADER
+ CmdSignatureDesc.ByteStride = sizeof(UINT) * 3;
+ IndirectArg.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH;
+ hr = pd3d12Device->CreateCommandSignature(&CmdSignatureDesc, nullptr, __uuidof(m_pDrawMeshIndirectSignature), reinterpret_cast<void**>(static_cast<ID3D12CommandSignature**>(&m_pDrawMeshIndirectSignature)));
+ CHECK_D3D_RESULT_THROW(hr, "Failed to create draw mesh indirect command signature");
+#endif
}
DeviceContextD3D12Impl::~DeviceContextD3D12Impl()
@@ -223,8 +230,11 @@ void DeviceContextD3D12Impl::SetPipelineState(IPipelineState* pPipelineState)
auto& GraphicsCtx = CmdCtx.AsGraphicsContext();
GraphicsCtx.SetPipelineState(pd3d12PSO);
- auto D3D12Topology = TopologyToD3D12Topology(PSODesc.GraphicsPipeline.PrimitiveTopology);
- GraphicsCtx.SetPrimitiveTopology(D3D12Topology);
+ if (PSODesc.PipelineType == PIPELINE_TYPE_GRAPHICS)
+ {
+ auto D3D12Topology = TopologyToD3D12Topology(PSODesc.GraphicsPipeline.PrimitiveTopology);
+ GraphicsCtx.SetPrimitiveTopology(D3D12Topology);
+ }
if (CommitStates)
{