summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-19 18:41:13 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-19 18:41:13 +0000
commitf6181c0d90eb7a6135353113ea153942df276bdc (patch)
tree64da0ba73c1761b4ef61e82c60b4977e9439eb51 /Graphics/GraphicsEngineD3D12
parentAdded convenience constructor to LayoutElement struct (diff)
downloadDiligentCore-f6181c0d90eb7a6135353113ea153942df276bdc.tar.gz
DiligentCore-f6181c0d90eb7a6135353113ea153942df276bdc.zip
Reworked Draw and DispatchCompute commands (Updated API version to 240033)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h45
-rw-r--r--Graphics/GraphicsEngineD3D12/include/RootSignature.h43
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp187
-rw-r--r--Graphics/GraphicsEngineD3D12/src/RootSignature.cpp36
4 files changed, 189 insertions, 122 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
index 49f1cad3..2bcb8004 100644
--- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
@@ -92,9 +92,13 @@ public:
ITextureView* pDepthStencil,
RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final;
- virtual void Draw( DrawAttribs& DrawAttribs )override final;
+ virtual void Draw (const DrawAttribs& Attribs)override final;
+ virtual void DrawIndexed (const DrawIndexedAttribs& Attribs)override final;
+ virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final;
+ virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final;
- virtual void DispatchCompute( const DispatchComputeAttribs& DispatchAttrs )override final;
+ virtual void DispatchCompute(const DispatchComputeAttribs& Attribs)override final;
+ virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final;
virtual void ClearDepthStencil(ITextureView* pView,
CLEAR_DEPTH_STENCIL_FLAGS ClearFlags,
@@ -222,24 +226,35 @@ public:
Int64 GetCurrentFrameNumber()const {return m_ContextFrameNumber; }
private:
- void CommitD3D12IndexBuffer(VALUE_TYPE IndexType);
+ void CommitD3D12IndexBuffer(GraphicsContext& GraphCtx, VALUE_TYPE IndexType);
void CommitD3D12VertexBuffers(class GraphicsContext& GraphCtx);
void CommitRenderTargets(RESOURCE_STATE_TRANSITION_MODE StateTransitionMode);
void CommitViewports();
void CommitScissorRects(class GraphicsContext &GraphCtx, bool ScissorEnable);
void Flush(bool RequestNewCmdCtx);
- void RequestCommandContext(RenderDeviceD3D12Impl* pDeviceD3D12Impl);
- inline void TransitionOrVerifyBufferState(CommandContext& CmdCtx,
- BufferD3D12Impl& Buffer,
- RESOURCE_STATE_TRANSITION_MODE TransitionMode,
- RESOURCE_STATE RequiredState,
- const char* OperationName);
- inline void TransitionOrVerifyTextureState(CommandContext& CmdCtx,
- TextureD3D12Impl& Texture,
- RESOURCE_STATE_TRANSITION_MODE TransitionMode,
- RESOURCE_STATE RequiredState,
- const char* OperationName);
-
+ __forceinline void RequestCommandContext(RenderDeviceD3D12Impl* pDeviceD3D12Impl);
+ __forceinline void TransitionOrVerifyBufferState(CommandContext& CmdCtx,
+ BufferD3D12Impl& Buffer,
+ RESOURCE_STATE_TRANSITION_MODE TransitionMode,
+ RESOURCE_STATE RequiredState,
+ const char* OperationName);
+ __forceinline void TransitionOrVerifyTextureState(CommandContext& CmdCtx,
+ TextureD3D12Impl& Texture,
+ RESOURCE_STATE_TRANSITION_MODE TransitionMode,
+ RESOURCE_STATE RequiredState,
+ const char* OperationName);
+
+ __forceinline void PrepareForDraw(GraphicsContext& GraphCtx, DRAW_FLAGS Flags);
+
+ __forceinline void PrepareForIndexedDraw(GraphicsContext& GraphCtx, DRAW_FLAGS Flags, VALUE_TYPE IndexType);
+
+ __forceinline void PrepareForDispatchCompute(ComputeContext& GraphCtx);
+
+ __forceinline void PrepareDrawIndirectBuffer(GraphicsContext& GraphCtx,
+ IBuffer* pAttribsBuffer,
+ RESOURCE_STATE_TRANSITION_MODE BufferStateTransitionMode,
+ ID3D12Resource*& pd3d12ArgsBuff,
+ size_t& BuffDataStartByteOffset);
struct TextureUploadSpace
{
diff --git a/Graphics/GraphicsEngineD3D12/include/RootSignature.h b/Graphics/GraphicsEngineD3D12/include/RootSignature.h
index 817dfd21..988cabd2 100644
--- a/Graphics/GraphicsEngineD3D12/include/RootSignature.h
+++ b/Graphics/GraphicsEngineD3D12/include/RootSignature.h
@@ -28,6 +28,7 @@
#include <array>
#include "ShaderD3DBase.h"
#include "ShaderResourceLayoutD3D12.h"
+#include "BufferD3D12Impl.h"
namespace Diligent
{
@@ -326,10 +327,10 @@ public:
void TransitionResources(ShaderResourceCacheD3D12& ResourceCache,
class CommandContext& Ctx)const;
- void CommitRootViews(ShaderResourceCacheD3D12& ResourceCache,
- class CommandContext& Ctx,
- bool IsCompute,
- class DeviceContextD3D12Impl* pCtx)const;
+ __forceinline void CommitRootViews(ShaderResourceCacheD3D12& ResourceCache,
+ class CommandContext& Ctx,
+ bool IsCompute,
+ class DeviceContextD3D12Impl* pCtx)const;
Uint32 GetTotalSrvCbvUavSlots(SHADER_RESOURCE_VARIABLE_TYPE VarType)const
{
@@ -488,4 +489,38 @@ private:
bool ValidateStates)const;
};
+void RootSignature::CommitRootViews(ShaderResourceCacheD3D12& ResourceCache,
+ CommandContext& Ctx,
+ bool IsCompute,
+ DeviceContextD3D12Impl* pCtx)const
+{
+ for (Uint32 rv = 0; rv < m_RootParams.GetNumRootViews(); ++rv)
+ {
+ auto& RootView = m_RootParams.GetRootView(rv);
+ auto RootInd = RootView.GetRootIndex();
+
+ SHADER_TYPE dbgShaderType = SHADER_TYPE_UNKNOWN;
+#ifdef _DEBUG
+ {
+ auto& Param = static_cast<const D3D12_ROOT_PARAMETER&>( RootView );
+ VERIFY_EXPR(Param.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV);
+ dbgShaderType = ShaderTypeFromShaderVisibility(Param.ShaderVisibility);
+ }
+#endif
+
+ auto& Res = ResourceCache.GetRootTable(RootInd).GetResource(0, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, dbgShaderType);
+ if (auto* pBuffToTransition = Res.pObject.RawPtr<BufferD3D12Impl>())
+ {
+ if (pBuffToTransition->IsInKnownState() && !pBuffToTransition->CheckState(RESOURCE_STATE_CONSTANT_BUFFER) )
+ Ctx.TransitionResource(pBuffToTransition, RESOURCE_STATE_CONSTANT_BUFFER);
+
+ D3D12_GPU_VIRTUAL_ADDRESS CBVAddress = pBuffToTransition->GetGPUAddress(pCtx);
+ if(IsCompute)
+ Ctx.GetCommandList()->SetComputeRootConstantBufferView(RootInd, CBVAddress);
+ else
+ Ctx.GetCommandList()->SetGraphicsRootConstantBufferView(RootInd, CBVAddress);
+ }
+ }
+}
+
}
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 9562e9f0..1a3a4985 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -268,7 +268,7 @@ namespace Diligent
}
}
- void DeviceContextD3D12Impl::CommitD3D12IndexBuffer(VALUE_TYPE IndexType)
+ void DeviceContextD3D12Impl::CommitD3D12IndexBuffer(GraphicsContext& GraphCtx, VALUE_TYPE IndexType)
{
VERIFY( m_pIndexBuffer != nullptr, "Index buffer is not set up for indexed draw command" );
@@ -308,8 +308,7 @@ namespace Diligent
m_State.CommittedD3D12IndexBuffer = pd3d12Buff;
m_State.CommittedIBFormat = IndexType;
m_State.CommittedD3D12IndexDataStartOffset = m_IndexDataStartOffset + static_cast<Uint32>(BuffDataStartByteOffset);
- auto& GraphicsCtx = GetCmdContext().AsGraphicsContext();
- GraphicsCtx.SetIndexBuffer( IBView );
+ GraphCtx.SetIndexBuffer( IBView );
}
// GPU virtual address of a dynamic index buffer can change every time
@@ -362,41 +361,20 @@ namespace Diligent
m_State.bCommittedD3D12VBsUpToDate = !DynamicBufferPresent;
}
- void DeviceContextD3D12Impl::Draw( DrawAttribs& drawAttribs )
+ void DeviceContextD3D12Impl::PrepareForDraw(GraphicsContext& GraphCtx, DRAW_FLAGS Flags)
{
#ifdef DEVELOPMENT
- if ((drawAttribs.Flags & DRAW_FLAG_VERIFY_DRAW_ATTRIBS) != 0 && !DvpVerifyDrawArguments(drawAttribs))
- return;
-
- if ((drawAttribs.Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0)
+ if ((Flags & DRAW_FLAG_VERIFY_RENDER_TARGETS) != 0)
DvpVerifyRenderTargets();
#endif
- const bool VerifyStates = (drawAttribs.Flags & DRAW_FLAG_VERIFY_STATES) != 0;
- auto& GraphCtx = GetCmdContext().AsGraphicsContext();
- if (drawAttribs.IsIndexed)
- {
- if (m_State.CommittedIBFormat != drawAttribs.IndexType)
- m_State.bCommittedD3D12IBUpToDate = false;
- if (!m_State.bCommittedD3D12IBUpToDate)
- {
- CommitD3D12IndexBuffer(drawAttribs.IndexType);
- }
-#ifdef DEVELOPMENT
- if (VerifyStates)
- {
- DvpVerifyBufferState(*m_pIndexBuffer, RESOURCE_STATE_INDEX_BUFFER, "Indexed draw (DeviceContextD3D12Impl::Draw())");
- }
-#endif
- }
-
if (!m_State.bCommittedD3D12VBsUpToDate && m_pPipelineState->GetNumBufferSlotsUsed() > 0)
{
CommitD3D12VertexBuffers(GraphCtx);
}
#ifdef DEVELOPMENT
- if (VerifyStates)
+ if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0)
{
for( Uint32 Buff = 0; Buff < m_NumVertexStreams; ++Buff )
{
@@ -409,6 +387,7 @@ namespace Diligent
}
}
#endif
+
GraphCtx.SetRootSignature( m_pPipelineState->GetD3D12RootSignature() );
if (m_State.pCommittedResourceCache != nullptr)
@@ -418,47 +397,107 @@ namespace Diligent
#ifdef DEVELOPMENT
else
{
- if( m_pPipelineState->dbgContainsShaderResources() )
+ if (m_pPipelineState->dbgContainsShaderResources())
LOG_ERROR_MESSAGE("Pipeline state '", m_pPipelineState->GetDesc().Name, "' contains shader resources, but IDeviceContext::CommitShaderResources() was not called with non-null SRB" );
}
#endif
-
+ }
- auto* pIndirectDrawAttribsD3D12 = ValidatedCast<BufferD3D12Impl>(drawAttribs.pIndirectDrawAttribs);
- if (pIndirectDrawAttribsD3D12 != nullptr)
+ void DeviceContextD3D12Impl::PrepareForIndexedDraw(GraphicsContext& GraphCtx, DRAW_FLAGS Flags, VALUE_TYPE IndexType)
+ {
+ PrepareForDraw(GraphCtx, Flags);
+ if (m_State.CommittedIBFormat != IndexType)
+ m_State.bCommittedD3D12IBUpToDate = false;
+ if (!m_State.bCommittedD3D12IBUpToDate)
{
+ CommitD3D12IndexBuffer(GraphCtx, IndexType);
+ }
#ifdef DEVELOPMENT
- if (pIndirectDrawAttribsD3D12->GetDesc().Usage == USAGE_DYNAMIC)
- pIndirectDrawAttribsD3D12->DvpVerifyDynamicAllocation(this);
+ if ((Flags & DRAW_FLAG_VERIFY_STATES) != 0)
+ {
+ DvpVerifyBufferState(*m_pIndexBuffer, RESOURCE_STATE_INDEX_BUFFER, "Indexed draw (DeviceContextD3D12Impl::Draw())");
+ }
#endif
+ }
- TransitionOrVerifyBufferState(GraphCtx, *pIndirectDrawAttribsD3D12, drawAttribs.IndirectAttribsBufferStateTransitionMode,
- RESOURCE_STATE_INDIRECT_ARGUMENT, "Indirect draw (DeviceContextD3D12Impl::Draw)");
+ void DeviceContextD3D12Impl::Draw(const DrawAttribs& Attribs)
+ {
+ if (!DvpVerifyDrawArguments(Attribs))
+ return;
- size_t BuffDataStartByteOffset;
- ID3D12Resource *pd3d12ArgsBuff = pIndirectDrawAttribsD3D12->GetD3D12Buffer(BuffDataStartByteOffset, this);
- GraphCtx.ExecuteIndirect(drawAttribs.IsIndexed ? m_pDrawIndexedIndirectSignature : m_pDrawIndirectSignature, pd3d12ArgsBuff, drawAttribs.IndirectDrawArgsOffset + BuffDataStartByteOffset);
- }
- else
- {
- if( drawAttribs.IsIndexed )
- GraphCtx.DrawIndexed(drawAttribs.NumIndices, drawAttribs.NumInstances, drawAttribs.FirstIndexLocation, drawAttribs.BaseVertex, drawAttribs.FirstInstanceLocation);
- else
- GraphCtx.Draw(drawAttribs.NumVertices, drawAttribs.NumInstances, drawAttribs.StartVertexLocation, drawAttribs.FirstInstanceLocation );
- }
+ auto& GraphCtx = GetCmdContext().AsGraphicsContext();
+ PrepareForDraw(GraphCtx, Attribs.Flags);
+ GraphCtx.Draw(Attribs.NumVertices, Attribs.NumInstances, Attribs.StartVertexLocation, Attribs.FirstInstanceLocation);
++m_State.NumCommands;
}
- void DeviceContextD3D12Impl::DispatchCompute( const DispatchComputeAttribs& DispatchAttrs )
+ void DeviceContextD3D12Impl::DrawIndexed(const DrawIndexedAttribs& Attribs)
{
-#ifdef DEVELOPMENT
- if (!DvpVerifyDispatchArguments(DispatchAttrs))
+ if (!DvpVerifyDrawIndexedArguments(Attribs))
return;
+
+ auto& GraphCtx = GetCmdContext().AsGraphicsContext();
+ PrepareForIndexedDraw(GraphCtx, Attribs.Flags, Attribs.IndexType);
+ GraphCtx.DrawIndexed(Attribs.NumIndices, Attribs.NumInstances, Attribs.FirstIndexLocation, Attribs.BaseVertex, Attribs.FirstInstanceLocation);
+ ++m_State.NumCommands;
+ }
+
+ void DeviceContextD3D12Impl::PrepareDrawIndirectBuffer(GraphicsContext& GraphCtx,
+ IBuffer* pAttribsBuffer,
+ RESOURCE_STATE_TRANSITION_MODE BufferStateTransitionMode,
+ ID3D12Resource*& pd3d12ArgsBuff,
+ size_t& BuffDataStartByteOffset)
+ {
+ DEV_CHECK_ERR(pAttribsBuffer != nullptr, "Indirect draw attribs buffer must not be null");
+
+ auto* pIndirectDrawAttribsD3D12 = ValidatedCast<BufferD3D12Impl>(pAttribsBuffer);
+#ifdef DEVELOPMENT
+ if (pIndirectDrawAttribsD3D12->GetDesc().Usage == USAGE_DYNAMIC)
+ pIndirectDrawAttribsD3D12->DvpVerifyDynamicAllocation(this);
#endif
- auto& ComputeCtx = GetCmdContext().AsComputeContext();
- ComputeCtx.SetRootSignature( m_pPipelineState->GetD3D12RootSignature() );
-
+ TransitionOrVerifyBufferState(GraphCtx, *pIndirectDrawAttribsD3D12, BufferStateTransitionMode,
+ RESOURCE_STATE_INDIRECT_ARGUMENT,
+ "Indirect draw (DeviceContextD3D12Impl::PrepareDrawIndirectBuffer)");
+
+ pd3d12ArgsBuff = pIndirectDrawAttribsD3D12->GetD3D12Buffer(BuffDataStartByteOffset, this);
+ }
+
+ void DeviceContextD3D12Impl::DrawIndirect(const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)
+ {
+ if (!DvpVerifyDrawIndirectArguments(Attribs, pAttribsBuffer))
+ return;
+
+ auto& GraphCtx = GetCmdContext().AsGraphicsContext();
+ PrepareForDraw(GraphCtx, Attribs.Flags);
+
+ ID3D12Resource* pd3d12ArgsBuff;
+ size_t BuffDataStartByteOffset;
+ PrepareDrawIndirectBuffer(GraphCtx, pAttribsBuffer, Attribs.IndirectAttribsBufferStateTransitionMode, pd3d12ArgsBuff, BuffDataStartByteOffset);
+
+ GraphCtx.ExecuteIndirect(m_pDrawIndirectSignature, pd3d12ArgsBuff, Attribs.IndirectDrawArgsOffset + BuffDataStartByteOffset);
+ ++m_State.NumCommands;
+ }
+
+ void DeviceContextD3D12Impl::DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)
+ {
+ if (!DvpVerifyDrawIndexedIndirectArguments(Attribs, pAttribsBuffer))
+ return;
+
+ auto& GraphCtx = GetCmdContext().AsGraphicsContext();
+ PrepareForIndexedDraw(GraphCtx, Attribs.Flags, Attribs.IndexType);
+
+ ID3D12Resource* pd3d12ArgsBuff;
+ size_t BuffDataStartByteOffset;
+ PrepareDrawIndirectBuffer(GraphCtx, pAttribsBuffer, Attribs.IndirectAttribsBufferStateTransitionMode, pd3d12ArgsBuff, BuffDataStartByteOffset);
+
+ GraphCtx.ExecuteIndirect(m_pDrawIndexedIndirectSignature, pd3d12ArgsBuff, Attribs.IndirectDrawArgsOffset + BuffDataStartByteOffset);
+ ++m_State.NumCommands;
+ }
+
+ void DeviceContextD3D12Impl::PrepareForDispatchCompute(ComputeContext& ComputeCtx)
+ {
+ ComputeCtx.SetRootSignature(m_pPipelineState->GetD3D12RootSignature());
if (m_State.pCommittedResourceCache != nullptr)
{
m_pPipelineState->GetRootSignature().CommitRootViews(*m_State.pCommittedResourceCache, ComputeCtx, true, this);
@@ -466,29 +505,43 @@ namespace Diligent
#ifdef _DEBUG
else
{
- if( m_pPipelineState->dbgContainsShaderResources() )
+ if (m_pPipelineState->dbgContainsShaderResources())
LOG_ERROR_MESSAGE("Pipeline state '", m_pPipelineState->GetDesc().Name, "' contains shader resources, but IDeviceContext::CommitShaderResources() was not called with non-null SRB" );
}
#endif
+ }
- if (DispatchAttrs.pIndirectDispatchAttribs != nullptr)
- {
- auto* pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(DispatchAttrs.pIndirectDispatchAttribs);
+ void DeviceContextD3D12Impl::DispatchCompute(const DispatchComputeAttribs& Attribs)
+ {
+ if (!DvpVerifyDispatchArguments(Attribs))
+ return;
+
+ auto& ComputeCtx = GetCmdContext().AsComputeContext();
+ PrepareForDispatchCompute(ComputeCtx);
+ ComputeCtx.Dispatch(Attribs.ThreadGroupCountX, Attribs.ThreadGroupCountY, Attribs.ThreadGroupCountZ);
+ ++m_State.NumCommands;
+ }
+
+ void DeviceContextD3D12Impl::DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)
+ {
+ if (!DvpVerifyDispatchIndirectArguments(Attribs, pAttribsBuffer))
+ return;
+
+ auto& ComputeCtx = GetCmdContext().AsComputeContext();
+ PrepareForDispatchCompute(ComputeCtx);
+
+ auto* pBufferD3D12 = ValidatedCast<BufferD3D12Impl>(pAttribsBuffer);
#ifdef DEVELOPMENT
- if(pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC)
- pBufferD3D12->DvpVerifyDynamicAllocation(this);
+ if(pBufferD3D12->GetDesc().Usage == USAGE_DYNAMIC)
+ pBufferD3D12->DvpVerifyDynamicAllocation(this);
#endif
- TransitionOrVerifyBufferState(ComputeCtx, *pBufferD3D12, DispatchAttrs.IndirectAttribsBufferStateTransitionMode,
- RESOURCE_STATE_INDIRECT_ARGUMENT, "Indirect dispatch (DeviceContextD3D12Impl::DispatchCompute)");
-
- size_t BuffDataStartByteOffset;
- ID3D12Resource *pd3d12ArgsBuff = pBufferD3D12->GetD3D12Buffer(BuffDataStartByteOffset, this);
- ComputeCtx.ExecuteIndirect(m_pDispatchIndirectSignature, pd3d12ArgsBuff, DispatchAttrs.DispatchArgsByteOffset + BuffDataStartByteOffset);
- }
- else
- ComputeCtx.Dispatch(DispatchAttrs.ThreadGroupCountX, DispatchAttrs.ThreadGroupCountY, DispatchAttrs.ThreadGroupCountZ);
+ TransitionOrVerifyBufferState(ComputeCtx, *pBufferD3D12, Attribs.IndirectAttribsBufferStateTransitionMode,
+ RESOURCE_STATE_INDIRECT_ARGUMENT, "Indirect dispatch (DeviceContextD3D12Impl::DispatchComputeIndirect)");
+ size_t BuffDataStartByteOffset;
+ ID3D12Resource* pd3d12ArgsBuff = pBufferD3D12->GetD3D12Buffer(BuffDataStartByteOffset, this);
+ ComputeCtx.ExecuteIndirect(m_pDispatchIndirectSignature, pd3d12ArgsBuff, Attribs.DispatchArgsByteOffset + BuffDataStartByteOffset);
++m_State.NumCommands;
}
diff --git a/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp b/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp
index a4895d33..d432042c 100644
--- a/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/RootSignature.cpp
@@ -29,7 +29,6 @@
#include "CommandContext.h"
#include "RenderDeviceD3D12Impl.h"
#include "TextureD3D12Impl.h"
-#include "BufferD3D12Impl.h"
#include "D3D12TypeConversions.h"
#include "HashUtils.h"
@@ -1093,39 +1092,4 @@ void RootSignature::TransitionResources(ShaderResourceCacheD3D12& ResourceCache,
);
}
-
-void RootSignature::CommitRootViews(ShaderResourceCacheD3D12& ResourceCache,
- CommandContext& Ctx,
- bool IsCompute,
- DeviceContextD3D12Impl* pCtx)const
-{
- for (Uint32 rv = 0; rv < m_RootParams.GetNumRootViews(); ++rv)
- {
- auto& RootView = m_RootParams.GetRootView(rv);
- auto RootInd = RootView.GetRootIndex();
-
- SHADER_TYPE dbgShaderType = SHADER_TYPE_UNKNOWN;
-#ifdef _DEBUG
- {
- auto& Param = static_cast<const D3D12_ROOT_PARAMETER&>( RootView );
- VERIFY_EXPR(Param.ParameterType == D3D12_ROOT_PARAMETER_TYPE_CBV);
- dbgShaderType = ShaderTypeFromShaderVisibility(Param.ShaderVisibility);
- }
-#endif
-
- auto& Res = ResourceCache.GetRootTable(RootInd).GetResource(0, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, dbgShaderType);
- if (auto* pBuffToTransition = Res.pObject.RawPtr<BufferD3D12Impl>())
- {
- if (pBuffToTransition->IsInKnownState() && !pBuffToTransition->CheckState(RESOURCE_STATE_CONSTANT_BUFFER) )
- Ctx.TransitionResource(pBuffToTransition, RESOURCE_STATE_CONSTANT_BUFFER);
-
- D3D12_GPU_VIRTUAL_ADDRESS CBVAddress = pBuffToTransition->GetGPUAddress(pCtx);
- if(IsCompute)
- Ctx.GetCommandList()->SetComputeRootConstantBufferView(RootInd, CBVAddress);
- else
- Ctx.GetCommandList()->SetGraphicsRootConstantBufferView(RootInd, CBVAddress);
- }
- }
-}
-
}