From 413569991bfb6debea4a0476279d656b44ba0acc Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 21 Dec 2020 15:40:29 -0800 Subject: Vulkan backend: few updates to shader resource layout initialization --- Graphics/GraphicsEngine/include/ShaderResourceVariableBase.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngine') 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(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; } -- cgit v1.2.3