diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-01-05 18:05:24 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-01-05 18:05:24 +0000 |
| commit | 171ac1cf6e29170ea6c92dd72df383ecafe9cefc (patch) | |
| tree | db0c8fa0e7f0084db0a17c14fc2f1623147f0c3e /Graphics/GraphicsEngineD3D12 | |
| parent | Fixed minor issue with ResourceMappingImpl::ResMappingHashKey::operator== (diff) | |
| download | DiligentCore-171ac1cf6e29170ea6c92dd72df383ecafe9cefc.tar.gz DiligentCore-171ac1cf6e29170ea6c92dd72df383ecafe9cefc.zip | |
D3D12 backend: do not create draw mesh indirect cmd signature if mesh shaders are not supported
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 5d36402e..ec14d2f5 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -122,10 +122,13 @@ DeviceContextD3D12Impl::DeviceContextD3D12Impl(IReferenceCounters* pRef CHECK_D3D_RESULT_THROW(hr, "Failed to create dispatch indirect command signature"); #ifdef D3D12_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"); + if (pDeviceD3D12Impl->GetDeviceCaps().Features.MeshShaders == DEVICE_FEATURE_STATE_ENABLED) + { + 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 } |
