summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-03-12 08:32:35 +0100
committerPaul Lemire <paul.lemire@kdab.com>2020-02-05 11:33:49 +0100
commit0e115ff000fb294de8519bf5b39beee0d6bfa605 (patch)
treec66c1f19ad5e4b7fc4f3be7951fa74d1d4df64bb /src/core
parentf1f387c22dac8748a7edb1f4aa1ea6dac7dfbdfd (diff)
Make the OpenGL renderer a plugin
By default the QRenderAspect will try to load this plugin Change-Id: Ie55e207fb8e6d0b64f717bbb99699eb669eaa3f2 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/resources/qresourcemanager_p.h39
-rw-r--r--src/core/transforms/matrix4x4_avx2_p.h1
-rw-r--r--src/core/transforms/matrix4x4_sse_p.h1
3 files changed, 11 insertions, 30 deletions
diff --git a/src/core/resources/qresourcemanager_p.h b/src/core/resources/qresourcemanager_p.h
index ba39695a4..6e479d5ef 100644
--- a/src/core/resources/qresourcemanager_p.h
+++ b/src/core/resources/qresourcemanager_p.h
@@ -179,19 +179,7 @@ private:
template <typename T>
struct QResourceInfo
{
- enum
- {
- needsCleanup = false
- };
-};
-
-template <>
-struct QResourceInfo<void>
-{
- enum
- {
- needsCleanup = false
- };
+ static const bool needsCleanup = false;
};
enum
@@ -204,22 +192,10 @@ enum
template<> \
struct QResourceInfo<TYPE > \
{ \
- enum \
-{ \
- needsCleanup = ((FLAGS & Q_REQUIRES_CLEANUP) == 0) \
-}; \
+ static const bool needsCleanup = (FLAGS & Q_REQUIRES_CLEANUP) == 0;\
}; \
} // namespace Qt3DCore
-template <int v>
-struct Int2Type
-{
- enum
- {
- value = v
- };
-};
-
template<typename T>
class QHandleData : public QHandle<T>::Data
{
@@ -275,7 +251,7 @@ public:
typename Handle::Data *d = handle.data_ptr();
d->nextFree = freeList;
freeList = d;
- performCleanup(&static_cast<QHandleData<T> *>(d)->data, Int2Type<QResourceInfo<T>::needsCleanup>());
+ performCleanup(&static_cast<QHandleData<T> *>(d)->data, std::integral_constant<bool, QResourceInfo<T>::needsCleanup>{});
}
T *data(Handle h)
@@ -349,13 +325,16 @@ private:
}
}
- void performCleanup(T *r, Int2Type<true>)
+ template<typename Q = T>
+ void performCleanup(Q *r, std::integral_constant<bool, true>)
{
r->cleanup();
}
- void performCleanup(T *, Int2Type<false>)
- {}
+ template<typename Q = T>
+ void performCleanup(Q *, std::integral_constant<bool, false>)
+ {
+ }
};
diff --git a/src/core/transforms/matrix4x4_avx2_p.h b/src/core/transforms/matrix4x4_avx2_p.h
index 63858b35c..0b35f0016 100644
--- a/src/core/transforms/matrix4x4_avx2_p.h
+++ b/src/core/transforms/matrix4x4_avx2_p.h
@@ -489,6 +489,7 @@ public:
friend Q_3DCORE_PRIVATE_EXPORT Vector3D operator*(const Matrix4x4_AVX2 &matrix, const Vector3D &vector);
friend Q_3DCORE_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Matrix4x4_AVX2 &m);
+
private:
// column major order
// aligned on 32 bytes boundaries for AVX, compatible with 16 bytes boundary for SSE
diff --git a/src/core/transforms/matrix4x4_sse_p.h b/src/core/transforms/matrix4x4_sse_p.h
index 0ea2e37ad..adef74daf 100644
--- a/src/core/transforms/matrix4x4_sse_p.h
+++ b/src/core/transforms/matrix4x4_sse_p.h
@@ -372,6 +372,7 @@ public:
friend Q_ALWAYS_INLINE Vector3D operator*(const Matrix4x4_SSE &matrix, const Vector3D &vector);
friend Q_3DCORE_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const Matrix4x4_SSE &m);
+
private:
// Internally we will store the matrix as indicated below
// Q_DECL_ALIGN(16) // aligned on 16 bytes boundary for SSE (column major)