From b725851ef36289c584d1abfbefdf80ff2b7c1421 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 7 May 2018 20:11:55 -0700 Subject: Updated comments for VK shader resource layout and cache classes --- Graphics/GLSLTools/include/SPIRVShaderResources.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Graphics/GLSLTools') 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 + 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; -- cgit v1.2.3