summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-02-20 00:08:39 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:09 +0000
commitabb6f8c12bdb7639ee4a200fa1243b1e6fb96dac (patch)
treef6dd312a1840b1955d2581cf1190092b5db76840 /Graphics/GraphicsEngineVulkan
parentMoved duplicate static resources logic from PipelineResourceSignatureD3D12Imp... (diff)
downloadDiligentCore-abb6f8c12bdb7639ee4a200fa1243b1e6fb96dac.tar.gz
DiligentCore-abb6f8c12bdb7639ee4a200fa1243b1e6fb96dac.zip
Unified static resource methods in PipelineResourceSignatureVkImpl and PipelineResourceSignatureD3D12Impl
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
index 2489ee10..9bff0621 100644
--- a/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp
@@ -747,51 +747,24 @@ void PipelineResourceSignatureVkImpl::CreateShaderResourceBinding(IShaderResourc
Uint32 PipelineResourceSignatureVkImpl::GetStaticVariableCount(SHADER_TYPE ShaderType) const
{
- const auto VarMngrInd = GetStaticVariableCountHelper(ShaderType);
- if (VarMngrInd < 0)
- return 0;
-
- auto& StaticVarMgr = m_StaticVarsMgrs[VarMngrInd];
- return StaticVarMgr.GetVariableCount();
+ return GetStaticVariableCountImpl(ShaderType, m_StaticVarsMgrs);
}
IShaderResourceVariable* PipelineResourceSignatureVkImpl::GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name)
{
- const auto VarMngrInd = GetStaticVariableByNameHelper(ShaderType, Name);
- if (VarMngrInd < 0)
- return nullptr;
-
- auto& StaticVarMgr = m_StaticVarsMgrs[VarMngrInd];
- return StaticVarMgr.GetVariable(Name);
+ return GetStaticVariableByNameImpl(ShaderType, Name, m_StaticVarsMgrs);
}
IShaderResourceVariable* PipelineResourceSignatureVkImpl::GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index)
{
- const auto VarMngrInd = GetStaticVariableByIndexHelper(ShaderType, Index);
- if (VarMngrInd < 0)
- return nullptr;
-
- const auto& StaticVarMgr = m_StaticVarsMgrs[VarMngrInd];
- return StaticVarMgr.GetVariable(Index);
+ return GetStaticVariableByIndexImpl(ShaderType, Index, m_StaticVarsMgrs);
}
void PipelineResourceSignatureVkImpl::BindStaticResources(Uint32 ShaderFlags,
IResourceMapping* pResMapping,
Uint32 Flags)
{
- const auto PipelineType = GetPipelineType();
- for (auto StaticResStageIdx : m_StaticResStageIndex)
- {
- if (StaticResStageIdx >= 0)
- {
- // ShaderInd is the shader type pipeline index here
- const auto ShaderType = GetShaderTypeFromPipelineIndex(StaticResStageIdx, PipelineType);
- if (ShaderFlags & ShaderType)
- {
- m_StaticVarsMgrs[StaticResStageIdx].BindResources(pResMapping, Flags);
- }
- }
- }
+ BindStaticResourcesImpl(ShaderFlags, pResMapping, Flags, m_StaticVarsMgrs);
}
void PipelineResourceSignatureVkImpl::InitSRBResourceCache(ShaderResourceCacheVk& ResourceCache,