summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-06-01 15:33:49 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-06-01 15:33:49 +0000
commite8f6cc0e5f96af00a4f8c384d0b086f5a4f703d4 (patch)
treef7195525bfc1fce251819b217a871df902f66414 /Graphics/GraphicsEngineD3D12
parentImplemented command pool manager to handle multithreaded resource initializat... (diff)
downloadDiligentCore-e8f6cc0e5f96af00a4f8c384d0b086f5a4f703d4.tar.gz
DiligentCore-e8f6cc0e5f96af00a4f8c384d0b086f5a4f703d4.zip
Implemented indirect rendering in Vk
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 7db39b9e..275ab744 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -355,22 +355,18 @@ namespace Diligent
if( DrawAttribs.IsIndirect )
{
- if( auto *pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(DrawAttribs.pIndirectDrawAttribs) )
- {
+ VERIFY(DrawAttribs.pIndirectDrawAttribs != nullptr, "Valid pIndirectDrawAttribs must be provided for indirect draw command");
+ auto *pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(DrawAttribs.pIndirectDrawAttribs);
+
#ifdef _DEBUG
- if(pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC)
- pBufferD3D12->DbgVerifyDynamicAllocation(m_ContextId);
+ if(pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC)
+ pBufferD3D12->DbgVerifyDynamicAllocation(m_ContextId);
#endif
- GraphCtx.TransitionResource(pBufferD3D12, D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT);
- size_t BuffDataStartByteOffset;
- ID3D12Resource *pd3d12ArgsBuff = pBufferD3D12->GetD3D12Buffer(BuffDataStartByteOffset, m_ContextId);
- GraphCtx.ExecuteIndirect(DrawAttribs.IsIndexed ? m_pDrawIndexedIndirectSignature : m_pDrawIndirectSignature, pd3d12ArgsBuff, DrawAttribs.IndirectDrawArgsOffset + BuffDataStartByteOffset);
- }
- else
- {
- LOG_ERROR_MESSAGE("Valid pIndirectDrawAttribs must be provided for indirect draw command");
- }
+ GraphCtx.TransitionResource(pBufferD3D12, D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT);
+ size_t BuffDataStartByteOffset;
+ ID3D12Resource *pd3d12ArgsBuff = pBufferD3D12->GetD3D12Buffer(BuffDataStartByteOffset, m_ContextId);
+ GraphCtx.ExecuteIndirect(DrawAttribs.IsIndexed ? m_pDrawIndexedIndirectSignature : m_pDrawIndirectSignature, pd3d12ArgsBuff, DrawAttribs.IndirectDrawArgsOffset + BuffDataStartByteOffset);
}
else
{