From 7981da51debc66aa78cda72a4b0be3fc3a74d634 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 6 Feb 2020 18:16:36 -0500 Subject: Float matrix intrinsic test/fixes (#1203) * Fix CPP construct when matrix type. * Test intrinsics on float matrices. * Fix typo in _areNearlyEqual test. Increased default sensitivity. Added matrix-float test. --- source/slang/slang-emit-cpp.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source') 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("{ "); } -- cgit v1.2.3