summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-21 23:40:29 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-21 23:40:29 +0000
commit413569991bfb6debea4a0476279d656b44ba0acc (patch)
treedc73f9877162599032044fefee93c3408395199e /Graphics/GraphicsEngine
parentVulkan backend: code clean-up (diff)
downloadDiligentCore-413569991bfb6debea4a0476279d656b44ba0acc.tar.gz
DiligentCore-413569991bfb6debea4a0476279d656b44ba0acc.zip
Vulkan backend: few updates to shader resource layout initialization
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
index fa322e30..b47207ed 100644
--- a/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
+++ b/Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp
@@ -104,6 +104,11 @@ inline bool IsAllowedType(SHADER_RESOURCE_VARIABLE_TYPE VarType, Uint32 AllowedT
return ((1 << VarType) & AllowedTypeBits) != 0;
}
+inline Uint32 GetAllowedTypeBit(SHADER_RESOURCE_VARIABLE_TYPE VarType)
+{
+ return 1 << static_cast<Uint32>(VarType);
+}
+
inline Uint32 GetAllowedTypeBits(const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVarTypes, Uint32 NumAllowedTypes) noexcept
{
if (AllowedVarTypes == nullptr)
@@ -111,7 +116,7 @@ inline Uint32 GetAllowedTypeBits(const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVar
Uint32 AllowedTypeBits = 0;
for (Uint32 i = 0; i < NumAllowedTypes; ++i)
- AllowedTypeBits |= 1 << AllowedVarTypes[i];
+ AllowedTypeBits |= GetAllowedTypeBit(AllowedVarTypes[i]);
return AllowedTypeBits;
}