From a9214f34358b2fc0bf61ef90e3719a13b180b423 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 8 Apr 2020 10:56:00 -0400 Subject: Remove static struct members from layout and reflection (#1310) * * Added MemberFilterStyle - controls action of FilteredMemberList and FilteredMemberRefList * Splt out template implementations * Use more standard method names dofr FilteredMemberRefList * Added reflect-static.slang test * Added isNotEmpty/isEmpty to filtered lists * Added ability to index into filtered list (so not require building of array) * Default MemberFilterStyle to All. * Remove explicit MemberFilterStyle::All --- source/slang/slang-type-layout.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/slang/slang-type-layout.cpp') diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp index bd0e6e8e0..f8c2bd377 100644 --- a/source/slang/slang-type-layout.cpp +++ b/source/slang/slang-type-layout.cpp @@ -3424,12 +3424,8 @@ static TypeLayoutResult _createTypeLayout( typeLayoutBuilder.beginLayout(type, rules); auto typeLayout = typeLayoutBuilder.getTypeLayout(); - for (auto field : GetFields(structDeclRef)) + for (auto field : GetFields(structDeclRef, MemberFilterStyle::Instance)) { - // Static fields shouldn't take part in layout. - if(field.getDecl()->HasModifier()) - continue; - // The fields of a `struct` type may include existential (interface) // types (including as nested sub-fields), and any types present // in those fields will need to be specialized based on the -- cgit v1.2.3