summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-03-11 19:07:09 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-03-11 19:07:09 +0000
commitbbbf3434aefd105662f9efd4bf9e7d56f9e8170b (patch)
tree42806921a62dcc82b4925927d52e9f453048e959 /Graphics/GraphicsEngineD3D12
parentEnabled full optimization (/Ox) for windows release builds (diff)
downloadDiligentCore-bbbf3434aefd105662f9efd4bf9e7d56f9e8170b.tar.gz
DiligentCore-bbbf3434aefd105662f9efd4bf9e7d56f9e8170b.zip
Implemented PSO compatibility in D3D11
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp7
-rw-r--r--Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp20
4 files changed, 19 insertions, 16 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
index 9af62ee0..9813ed59 100644
--- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h
@@ -55,6 +55,8 @@ public:
virtual void CreateShaderResourceBinding( IShaderResourceBinding **ppShaderResourceBinding )override;
+ virtual bool IsCompatibleWith(const IPipelineState *pPSO)const override final;
+
virtual ID3D12RootSignature *GetD3D12RootSignature()const override final{return m_RootSig.GetD3D12RootSignature(); }
ShaderResourceCacheD3D12* CommitAndTransitionShaderResources(IShaderResourceBinding *pShaderResourceBinding,
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index 6c9a41be..7470424f 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -184,13 +184,8 @@ namespace Diligent
void DeviceContextD3D12Impl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags)
{
-#ifdef _DEBUG
- if (!m_pPipelineState)
- {
- LOG_ERROR("No pipeline state is bound");
+ if (!DeviceContextBase::CommitShaderResources<PipelineStateD3D12Impl>(pShaderResourceBinding, Flags, 0 /*Dummy*/))
return;
- }
-#endif
auto *pCtx = RequestCmdContext();
auto *pPipelineStateD3D12 = ValidatedCast<PipelineStateD3D12Impl>(m_pPipelineState.RawPtr());
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
index 4c9442e4..7fe35e92 100644
--- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
@@ -265,6 +265,12 @@ void PipelineStateD3D12Impl::CreateShaderResourceBinding(IShaderResourceBinding
pResBindingD3D12->QueryInterface(IID_ShaderResourceBinding, reinterpret_cast<IObject**>(ppShaderResourceBinding));
}
+bool PipelineStateD3D12Impl::IsCompatibleWith(const IPipelineState *pPSO)const
+{
+ UNSUPPORTED("Not yet implemented");
+ return false;
+}
+
const ShaderResourceLayoutD3D12& PipelineStateD3D12Impl::GetShaderResLayout(SHADER_TYPE ShaderType)const
{
auto ShaderInd = GetShaderTypeIndex(ShaderType);
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
index e94ab1d8..5fc8d9b5 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourceLayoutD3D12.cpp
@@ -192,12 +192,12 @@ void ShaderResourceLayoutD3D12::Initialize(ID3D12Device *pd3d12Device,
m_pResources->ProcessResources(
AllowedVarTypes, NumAllowedTypes,
- [&](const D3DShaderResourceAttribs &CB)
+ [&](const D3DShaderResourceAttribs &CB, Uint32)
{
VERIFY_EXPR(IsAllowedType(CB.GetVariableType(), AllowedTypeBits));
++m_NumCbvSrvUav[CB.GetVariableType()];
},
- [&](const D3DShaderResourceAttribs& TexSRV)
+ [&](const D3DShaderResourceAttribs& TexSRV, Uint32)
{
auto VarType = TexSRV.GetVariableType();
VERIFY_EXPR(IsAllowedType(VarType, AllowedTypeBits));
@@ -213,17 +213,17 @@ void ShaderResourceLayoutD3D12::Initialize(ID3D12Device *pd3d12Device,
}
}
},
- [&](const D3DShaderResourceAttribs &TexUAV)
+ [&](const D3DShaderResourceAttribs &TexUAV, Uint32)
{
VERIFY_EXPR(IsAllowedType(TexUAV.GetVariableType(), AllowedTypeBits));
++m_NumCbvSrvUav[TexUAV.GetVariableType()];
},
- [&](const D3DShaderResourceAttribs &BufSRV)
+ [&](const D3DShaderResourceAttribs &BufSRV, Uint32)
{
VERIFY_EXPR(IsAllowedType(BufSRV.GetVariableType(), AllowedTypeBits));
++m_NumCbvSrvUav[BufSRV.GetVariableType()];
},
- [&](const D3DShaderResourceAttribs &BufUAV)
+ [&](const D3DShaderResourceAttribs &BufUAV, Uint32)
{
VERIFY_EXPR(IsAllowedType(BufUAV.GetVariableType(), AllowedTypeBits));
++m_NumCbvSrvUav[BufUAV.GetVariableType()];
@@ -277,12 +277,12 @@ void ShaderResourceLayoutD3D12::Initialize(ID3D12Device *pd3d12Device,
m_pResources->ProcessResources(
AllowedVarTypes, NumAllowedTypes,
- [&](const D3DShaderResourceAttribs &CB)
+ [&](const D3DShaderResourceAttribs &CB, Uint32)
{
VERIFY_EXPR( IsAllowedType(CB.GetVariableType(), AllowedTypeBits) );
AddResource(CB, CachedResourceType::CBV);
},
- [&](const D3DShaderResourceAttribs& TexSRV)
+ [&](const D3DShaderResourceAttribs& TexSRV, Uint32)
{
auto VarType = TexSRV.GetVariableType();
VERIFY_EXPR(IsAllowedType(VarType, AllowedTypeBits) );
@@ -335,17 +335,17 @@ void ShaderResourceLayoutD3D12::Initialize(ID3D12Device *pd3d12Device,
}
AddResource(TexSRV, CachedResourceType::TexSRV, SamplerId);
},
- [&](const D3DShaderResourceAttribs &TexUAV)
+ [&](const D3DShaderResourceAttribs &TexUAV, Uint32)
{
VERIFY_EXPR( IsAllowedType(TexUAV.GetVariableType(), AllowedTypeBits) );
AddResource(TexUAV, CachedResourceType::TexUAV);
},
- [&](const D3DShaderResourceAttribs &BufSRV)
+ [&](const D3DShaderResourceAttribs &BufSRV, Uint32)
{
VERIFY_EXPR( IsAllowedType(BufSRV.GetVariableType(), AllowedTypeBits) );
AddResource(BufSRV, CachedResourceType::BufSRV);
},
- [&](const D3DShaderResourceAttribs &BufUAV)
+ [&](const D3DShaderResourceAttribs &BufUAV, Uint32)
{
VERIFY_EXPR( IsAllowedType(BufUAV.GetVariableType(), AllowedTypeBits) );
AddResource(BufUAV, CachedResourceType::BufUAV);