diff options
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 059de0be8..00ecfdbc1 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -946,6 +946,12 @@ SLANG_API size_t spReflectionTypeLayout_GetElementStride(SlangReflectionTypeLayo return 0; } } + else if (auto vectorTypeLayout = as<VectorTypeLayout>(typeLayout)) + { + auto resInfo = vectorTypeLayout->elementTypeLayout->FindResourceInfo(LayoutResourceKind::Uniform); + if (!resInfo) return 0; + return resInfo->count.getFiniteValue(); + } return 0; } @@ -971,7 +977,14 @@ SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_GetElementTypeLayout { return convert(specializedTypeLayout->baseTypeLayout.Ptr()); } - + else if (auto vectorTypeLayout = as<VectorTypeLayout>(typeLayout)) + { + return convert(vectorTypeLayout->elementTypeLayout); + } + else if (auto matrixTypeLayout = as<MatrixTypeLayout>(typeLayout)) + { + return convert(matrixTypeLayout->elementTypeLayout); + } return nullptr; } |
