diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-cpp.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index ae1798382..99d1fbf22 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -1145,11 +1145,19 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice& emitType(retType); writer->emit("{ "); + IRType* dstElemType = _getElementType(retType); //IRType* srcElemType = _getElementType(srcType); TypeDimension dim = _getTypeDimension(srcType, false); + UnownedStringSlice rowTypeName; + if (dim.rowCount > 1) + { + IRType* rowType = m_typeSet.addVectorType(dstElemType, int(dim.colCount)); + rowTypeName = _getTypeName(rowType); + } + for (int i = 0; i < dim.rowCount; ++i) { if (dim.rowCount > 1) @@ -1158,6 +1166,7 @@ void CPPSourceEmitter::_emitConstructConvertDefinition(const UnownedStringSlice& { writer->emit(", \n"); } + writer->emit(rowTypeName); writer->emit("{ "); } |
