1 | // Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com> |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DCORE_MATRIX4X4_P_H |
5 | #define QT3DCORE_MATRIX4X4_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt3D API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <private/qsimd_p.h> |
19 | |
20 | // Check if we can use the optimized version of QMatrix4x4 |
21 | #if defined(__SSE2__) |
22 | |
23 | #include <Qt3DCore/private/matrix4x4_sse_p.h> |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | using Matrix4x4 = Qt3DCore::Matrix4x4_SSE; |
27 | QT_END_NAMESPACE |
28 | |
29 | #else |
30 | |
31 | #include <QMatrix4x4> |
32 | |
33 | QT_BEGIN_NAMESPACE |
34 | using Matrix4x4 = QMatrix4x4; |
35 | QT_END_NAMESPACE |
36 | |
37 | #endif |
38 | |
39 | template<typename UsingType> |
40 | Q_ALWAYS_INLINE QMatrix4x4 convertToQMatrix4x4(const UsingType &v) |
41 | { |
42 | return v.toQMatrix4x4(); |
43 | } |
44 | |
45 | template<> |
46 | Q_ALWAYS_INLINE QMatrix4x4 convertToQMatrix4x4<QMatrix4x4>(const QMatrix4x4 &v) |
47 | { |
48 | return v; |
49 | } |
50 | |
51 | #endif // QT3DCORE_MATRIX4X4_P_H |
52 | |