diff options
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index c5d39859e..a14bb4ac1 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -3516,6 +3516,21 @@ SLANG_API SlangReflectionModifier* spReflectionFunction_FindModifier( return spReflectionVariable_FindModifier(varRefl, modifierID); } +SLANG_API SlangReflectionModifier* spReflectionDecl_findModifier( + SlangReflectionDecl* decl, + SlangModifierID modifierID) +{ + Decl* slangDecl = (Decl*)decl; + if (!slangDecl) + return nullptr; + + auto varRefl = convert(DeclRef<Decl>(slangDecl)); + if (!varRefl) + return nullptr; + + return spReflectionVariable_FindModifier(varRefl, modifierID); +} + SLANG_API unsigned int spReflectionFunction_GetUserAttributeCount(SlangReflectionFunction* inFunc) { auto func = convertToFunc(inFunc); |
