diff options
Diffstat (limited to 'source/slang/reflection.cpp')
| -rw-r--r-- | source/slang/reflection.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index 4ac48d2e7..4d13052f6 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -279,6 +279,10 @@ SLANG_API SlangTypeKind spReflectionType_GetKind(SlangReflectionType* inType) return SLANG_TYPE_KIND_INTERFACE; } } + else if( auto specializedType = as<ExistentialSpecializedType>(type) ) + { + return SLANG_TYPE_KIND_SPECIALIZED; + } else if (auto errorType = as<ErrorType>(type)) { // This means we saw a type we didn't understand in the user's code @@ -746,6 +750,10 @@ SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_GetElementTypeLayout { return convert(structuredBufferTypeLayout->elementTypeLayout.Ptr()); } + else if( auto specializedTypeLayout = as<ExistentialSpecializedTypeLayout>(typeLayout) ) + { + return convert(specializedTypeLayout->baseTypeLayout.Ptr()); + } return nullptr; } @@ -878,6 +886,22 @@ SLANG_API SlangReflectionVariableLayout* spReflectionVariableLayout_getPendingDa return convert(pendingDataLayout); } +SLANG_API SlangReflectionVariableLayout* spReflectionTypeLayout_getSpecializedTypePendingDataVarLayout(SlangReflectionTypeLayout* inTypeLayout) +{ + auto typeLayout = convert(inTypeLayout); + if(!typeLayout) return nullptr; + + if( auto specializedTypeLayout = as<ExistentialSpecializedTypeLayout>(typeLayout) ) + { + auto pendingDataVarLayout = specializedTypeLayout->pendingDataVarLayout.Ptr(); + return convert(pendingDataVarLayout); + } + else + { + return nullptr; + } +} + // Variable Reflection |
