diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-06 18:16:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-06 15:16:36 -0800 |
| commit | 7981da51debc66aa78cda72a4b0be3fc3a74d634 (patch) | |
| tree | b5b4372530c1413f1d23f207c1936d93e4049ac9 /source | |
| parent | d3331fba6eaab44646010b556106da38925d43e0 (diff) | |
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.
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("{ "); } |
