summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-10-19 03:28:09 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-10-19 03:28:09 +0000
commitf93288162c398987d238e4ead5186d8b2000fc5a (patch)
tree4905a6ae3e1780f4562fa7531b2b1f86efdda592 /Graphics/GraphicsEngineVulkan
parentImplemented separate samplers in D3D12 (diff)
downloadDiligentCore-f93288162c398987d238e4ead5186d8b2000fc5a.tar.gz
DiligentCore-f93288162c398987d238e4ead5186d8b2000fc5a.zip
Updated BIND_SHADER_RESOURCES_* flags
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
index f1019e7c..0751cd50 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVariableVk.cpp
@@ -159,6 +159,9 @@ void ShaderVariableManagerVk::BindResources( IResourceMapping* pResourceMapping,
return;
}
+ if ( (Flags & BIND_SHADER_RESOURCES_UPDATE_ALL) == 0 )
+ Flags |= BIND_SHADER_RESOURCES_UPDATE_ALL;
+
for(Uint32 v=0; v < m_NumVariables; ++v)
{
auto &Var = m_pVariables[v];
@@ -168,12 +171,12 @@ void ShaderVariableManagerVk::BindResources( IResourceMapping* pResourceMapping,
if(Res.SpirvAttribs.Type == SPIRVShaderResourceAttribs::ResourceType::SeparateSampler && Res.SpirvAttribs.StaticSamplerInd >= 0)
continue;
+ if ( (Flags & (1 << Res.SpirvAttribs.VarType)) == 0 )
+ continue;
+
for(Uint32 ArrInd = 0; ArrInd < Res.SpirvAttribs.ArraySize; ++ArrInd)
{
- if( Flags & BIND_SHADER_RESOURCES_RESET_BINDINGS )
- Res.BindResource(nullptr, ArrInd, *m_pResourceCache);
-
- if( (Flags & BIND_SHADER_RESOURCES_UPDATE_UNRESOLVED) && Res.IsBound(ArrInd, *m_pResourceCache) )
+ if( (Flags & BIND_SHADER_RESOURCES_KEEP_EXISTING) && Res.IsBound(ArrInd, *m_pResourceCache) )
continue;
const auto* VarName = Res.SpirvAttribs.Name;
@@ -185,7 +188,7 @@ void ShaderVariableManagerVk::BindResources( IResourceMapping* pResourceMapping,
}
else
{
- if( (Flags & BIND_SHADER_RESOURCES_ALL_RESOLVED) && !Res.IsBound(ArrInd, *m_pResourceCache) )
+ if( (Flags & BIND_SHADER_RESOURCES_VERIFY_ALL_RESOLVED) && !Res.IsBound(ArrInd, *m_pResourceCache) )
LOG_ERROR_MESSAGE( "Cannot bind resource to shader variable \"", Res.SpirvAttribs.GetPrintName(ArrInd), "\": resource view not found in the resource mapping" );
}
}