diff options
Diffstat (limited to 'Graphics/GLSLTools')
| -rw-r--r-- | Graphics/GLSLTools/include/SPIRVShaderResources.h | 15 |
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; |
