diff options
| author | Yong He <yonghe@outlook.com> | 2021-05-21 16:38:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-21 16:38:33 -0700 |
| commit | 7f8a9994d0bd99a171a1daa0bce46d92c02ccffd (patch) | |
| tree | 0b187e63ab5b9ce6f5ab41266fedaec44091a217 /tools/gfx-util/shader-cursor.cpp | |
| parent | 172538fdb418f7a2faab1f5a410f3b2cb8e18ba5 (diff) | |
[gfx] Support StructuredBuffer<IInterface>. (#1851)
Co-authored-by: T. Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tools/gfx-util/shader-cursor.cpp')
| -rw-r--r-- | tools/gfx-util/shader-cursor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/gfx-util/shader-cursor.cpp b/tools/gfx-util/shader-cursor.cpp index b188901ec..afb1540d5 100644 --- a/tools/gfx-util/shader-cursor.cpp +++ b/tools/gfx-util/shader-cursor.cpp @@ -144,7 +144,18 @@ Result ShaderCursor::getField(const char* name, const char* nameEnd, ShaderCurso ShaderCursor ShaderCursor::getElement(SlangInt index) const { - // TODO: need to auto-dereference various buffer types... + if (m_containerType != ShaderObjectContainerType::None) + { + ShaderCursor elementCursor; + elementCursor.m_baseObject = m_baseObject; + elementCursor.m_typeLayout = m_typeLayout->getElementTypeLayout(); + elementCursor.m_containerType = m_containerType; + elementCursor.m_offset.uniformOffset = index * m_typeLayout->getStride(); + elementCursor.m_offset.bindingRangeIndex = 0; + elementCursor.m_offset.bindingArrayIndex = index; + return elementCursor; + } + switch( m_typeLayout->getKind() ) { case slang::TypeReflection::Kind::Array: |
