summaryrefslogtreecommitdiffstats
path: root/Graphics/GLSLTools
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-05-08 03:11:55 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-05-08 03:11:55 +0000
commitb725851ef36289c584d1abfbefdf80ff2b7c1421 (patch)
treef8f02546835b366bb5d26f7b4a1c0f9a15e87cf1 /Graphics/GLSLTools
parentUpdated VK Shader Resource layout to use one binding for resource arrays (diff)
downloadDiligentCore-b725851ef36289c584d1abfbefdf80ff2b7c1421.tar.gz
DiligentCore-b725851ef36289c584d1abfbefdf80ff2b7c1421.zip
Updated comments for VK shader resource layout and cache classes
Diffstat (limited to 'Graphics/GLSLTools')
-rw-r--r--Graphics/GLSLTools/include/SPIRVShaderResources.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Graphics/GLSLTools/include/SPIRVShaderResources.h b/Graphics/GLSLTools/include/SPIRVShaderResources.h
index 2a9b67d9..5c41d31a 100644
--- a/Graphics/GLSLTools/include/SPIRVShaderResources.h
+++ b/Graphics/GLSLTools/include/SPIRVShaderResources.h
@@ -235,6 +235,21 @@ public:
}
}
+ template<typename THandler>
+ void ProcessResources(const SHADER_VARIABLE_TYPE *AllowedVarTypes,
+ Uint32 NumAllowedTypes,
+ THandler Handler)const
+ {
+ Uint32 AllowedTypeBits = GetAllowedTypeBits(AllowedVarTypes, NumAllowedTypes);
+
+ for(Uint32 n=0; n < GetTotalResources(); ++n)
+ {
+ const auto& Res = GetResource(n);
+ if( IsAllowedType(Res.VarType, AllowedTypeBits) )
+ Handler(UB, n);
+ }
+ }
+
//bool IsCompatibleWith(const ShaderResources &Resources)const;
//size_t GetHash()const;