summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-09-16 19:41:57 +0000
committerazhirnov <zh1dron@gmail.com>2020-09-16 19:41:57 +0000
commita0488c54c6c5017c71198d8b13c9ed75894791de (patch)
treec5c72716c2b970b860b9da0cf1eb3d319237f478 /Graphics/GraphicsEngineVulkan
parentAnother improvement to texture format tests in OpenGL (diff)
downloadDiligentCore-a0488c54c6c5017c71198d8b13c9ed75894791de.tar.gz
DiligentCore-a0488c54c6c5017c71198d8b13c9ed75894791de.zip
use NUM_SHADER_TYPES constant instead of magic number, use std::array instead of c-style array.
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp6
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
index d3915425..d93a72ac 100644
--- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.hpp
@@ -78,9 +78,9 @@ private:
ShaderVariableManagerVk* m_pShaderVarMgrs = nullptr;
// Shader variable manager index in m_pShaderVarMgrs[] array for every shader stage
- Int8 m_ResourceLayoutIndex[6] = {-1, -1, -1, -1, -1, -1};
- bool m_bStaticResourcesInitialized = false;
- Uint8 m_NumShaders = 0;
+ std::array<Int8, NUM_SHADER_TYPES> m_ResourceLayoutIndex;
+ bool m_bStaticResourcesInitialized = false;
+ Uint8 m_NumShaders = 0;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
index ee6a3709..b978c592 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderResourceBindingVkImpl.cpp
@@ -47,6 +47,8 @@ ShaderResourceBindingVkImpl::ShaderResourceBindingVkImpl(IReferenceCounters* pR
m_ShaderResourceCache{ShaderResourceCacheVk::DbgCacheContentType::SRBResources}
// clang-format on
{
+ m_ResourceLayoutIndex.fill(-1);
+
auto* ppShaders = pPSO->GetShaders();
m_NumShaders = static_cast<decltype(m_NumShaders)>(pPSO->GetNumShaders());