diff options
| author | Yong He <yonghe@outlook.com> | 2022-09-05 02:11:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-05 02:11:47 -0700 |
| commit | c1ee977fb9cd093e58715fe0dea00942d92ef71a (patch) | |
| tree | e18c6ed09c8044ca7caedd9f941b66d6dd19e9f1 /source/slang/slang-ir-any-value-marshalling.cpp | |
| parent | ea0845285b0307d153a91d6f0a5010fc2d7219ed (diff) | |
Fix matrix packing/unpacking logic. (#2393)
Include indirectly referenced witness table in dynamic dispatch.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-any-value-marshalling.cpp')
| -rw-r--r-- | source/slang/slang-ir-any-value-marshalling.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index ea1a6cf32..f1a1982c2 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -160,18 +160,19 @@ namespace Slang auto elementType = matrixType->getElementType(); auto colCount = getIntVal(matrixType->getColumnCount()); auto rowCount = getIntVal(matrixType->getRowCount()); + auto rowVecType = builder->getVectorType(elementType, matrixType->getRowCount()); for (IRIntegerValue i = 0; i < colCount; i++) { auto col = builder->emitElementAddress( - elementType, + builder->getPtrType(rowVecType), concreteTypedVar, builder->getIntValue(builder->getIntType(), i)); for (IRIntegerValue j = 0; j < rowCount; j++) { - auto element = builder->emitElementExtract( - elementType, + auto element = builder->emitElementAddress( + builder->getPtrType(elementType), col, - builder->getIntValue(builder->getIntType(), i)); + builder->getIntValue(builder->getIntType(), j)); emitMarshallingCode(builder, context, element); } } |
