summaryrefslogtreecommitdiffstats
path: root/tests/auto/render
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/render')
-rw-r--r--tests/auto/render/CMakeLists.txt8
-rw-r--r--tests/auto/render/alignedresourcesmanagers-avx/CMakeLists.txt22
-rw-r--r--tests/auto/render/alignedresourcesmanagers-avx/alignedresourcesmanagers-avx.pro9
-rw-r--r--tests/auto/render/alignedresourcesmanagers-avx/tst_alignedresourcesmanagers-avx.cpp98
-rw-r--r--tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp6
5 files changed, 8 insertions, 135 deletions
diff --git a/tests/auto/render/CMakeLists.txt b/tests/auto/render/CMakeLists.txt
index c5c68a081..9285364f2 100644
--- a/tests/auto/render/CMakeLists.txt
+++ b/tests/auto/render/CMakeLists.txt
@@ -108,8 +108,6 @@ if(QT_FEATURE_private_tests)
add_subdirectory(uniform)
add_subdirectory(vsyncframeadvanceservice)
add_subdirectory(waitfence)
-endif()
-if(QT_FEATURE_private_tests AND NOT QT_FEATURE_qt3d_simd_avx2)
add_subdirectory(qray3d)
add_subdirectory(raycasting)
add_subdirectory(triangleboundingvolume)
@@ -143,9 +141,7 @@ if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_input AND QT_FEATURE_qt3d_opengl
add_subdirectory(qscene2d)
add_subdirectory(scene2d)
endif()
-if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer AND QT_FEATURE_qt3d_simd_avx2)
- add_subdirectory(alignedresourcesmanagers-avx)
-endif()
-if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer AND QT_FEATURE_qt3d_simd_sse2 AND NOT QT_FEATURE_qt3d_simd_avx2)
+if(QT_FEATURE_private_tests AND NOT (CMAKE_OSX_ARCHITECTURES MATCHES ";") AND
+ (TEST_architecture_arch STREQUAL i386 OR TEST_architecture_arch STREQUAL x86_64))
add_subdirectory(alignedresourcesmanagers-sse)
endif()
diff --git a/tests/auto/render/alignedresourcesmanagers-avx/CMakeLists.txt b/tests/auto/render/alignedresourcesmanagers-avx/CMakeLists.txt
deleted file mode 100644
index 01fd43629..000000000
--- a/tests/auto/render/alignedresourcesmanagers-avx/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-# Generated from alignedresourcesmanagers-avx.pro.
-
-#####################################################################
-## tst_alignedresourcesmanagers-avx Test:
-#####################################################################
-
-qt_internal_add_test(tst_alignedresourcesmanagers-avx
- SOURCES
- tst_alignedresourcesmanagers-avx.cpp
- LIBRARIES
- Qt::3DCore
- Qt::3DCorePrivate
- Qt::3DRender
- Qt::3DRenderPrivate
- Qt::Gui
-)
-
-#### Keys ignored in scope 1:.:.:alignedresourcesmanagers-avx.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/auto/render/alignedresourcesmanagers-avx/alignedresourcesmanagers-avx.pro b/tests/auto/render/alignedresourcesmanagers-avx/alignedresourcesmanagers-avx.pro
deleted file mode 100644
index 28ec7337d..000000000
--- a/tests/auto/render/alignedresourcesmanagers-avx/alignedresourcesmanagers-avx.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TARGET = tst_alignedresourcesmanagers-avx
-CONFIG += testcase simd
-TEMPLATE = app
-
-SOURCES += tst_alignedresourcesmanagers-avx.cpp
-
-QT += testlib 3dcore 3dcore-private 3drender 3drender-private
-
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2
diff --git a/tests/auto/render/alignedresourcesmanagers-avx/tst_alignedresourcesmanagers-avx.cpp b/tests/auto/render/alignedresourcesmanagers-avx/tst_alignedresourcesmanagers-avx.cpp
deleted file mode 100644
index 83ab2e406..000000000
--- a/tests/auto/render/alignedresourcesmanagers-avx/tst_alignedresourcesmanagers-avx.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (C) 2017 Paul Lemire <paul.lemire350@gmail.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#include <QtTest/QtTest>
-#include <Qt3DCore/qnodeid.h>
-#include <Qt3DCore/private/matrix4x4_avx2_p.h>
-#include <Qt3DCore/private/qresourcemanager_p.h>
-#include <Qt3DRender/private/cameralens_p.h>
-
-using namespace Qt3DCore;
-
-using HMatrix = Qt3DCore::QHandle<Matrix4x4_AVX2>;
-using HCameraLens = Qt3DCore::QHandle<Qt3DRender::Render::CameraLens>;
-
-class MatrixManager : public Qt3DCore::QResourceManager<
- Matrix4x4_AVX2,
- Qt3DCore::QNodeId,
- Qt3DCore::NonLockingPolicy>
-{
-public:
- MatrixManager() {}
-};
-
-class CameraLensManager : public Qt3DCore::QResourceManager<
- Qt3DRender::Render::CameraLens,
- Qt3DCore::QNodeId,
- Qt3DCore::NonLockingPolicy>
-{
-public:
- CameraLensManager() {}
-};
-
-
-class tst_AlignedResourcesManagersAVX: public QObject
-{
- Q_OBJECT
-
-private Q_SLOTS:
-
- void checkAllocationAndAlignmentMatrix4x4()
- {
- // GIVEN
- MatrixManager manager;
-
- // WHEN
- for (uint i = 0; i < std::numeric_limits<ushort>::max(); ++i)
- manager.getOrCreateResource(Qt3DCore::QNodeId::createId());
-
- // THEN
- // Shouldn't crash
-
- const std::vector<HMatrix> &activeHandles = manager.activeHandles();
- for (const HMatrix handle : activeHandles) {
- // WHEN
- Matrix4x4_AVX2 *mat = manager.data(handle);
- // THEN
- QCOMPARE(int((uintptr_t)mat % 32), 0);
- }
-
- // WHEN
- for (uint i = 2; i < std::numeric_limits<ushort>::max(); ++i) {
- Matrix4x4_AVX2 *mat1 = manager.data(activeHandles.at(i - 2));
- Matrix4x4_AVX2 *mat2 = manager.data(activeHandles.at(i - 1));
- Matrix4x4_AVX2 *mat3 = manager.data(activeHandles.at(i));
-
- // WHEN
- *mat3 = (*mat2 * *mat1);
-
- // THEN
- // Shouldn't crash
- }
- }
-
- void checkAllocationAndAlignmentCameraLens()
- {
- // GIVEN
- CameraLensManager manager;
-
- // WHEN
- for (uint i = 0; i < std::numeric_limits<ushort>::max(); ++i)
- manager.getOrCreateResource(Qt3DCore::QNodeId::createId());
-
- // THEN
- // Shouldn't crash
-
- const std::vector<HCameraLens> &activeHandles = manager.activeHandles();
- for (const HCameraLens handle : activeHandles) {
- // WHEN
- Qt3DRender::Render::CameraLens *lens = manager.data(handle);
- // THEN
- QCOMPARE(int((uintptr_t)lens % 32), 0);
- }
- }
-};
-
-QTEST_MAIN(tst_AlignedResourcesManagersAVX)
-
-#include "tst_alignedresourcesmanagers-avx.moc"
diff --git a/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp b/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp
index b6d699fd5..04ccd904d 100644
--- a/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp
+++ b/tests/auto/render/alignedresourcesmanagers-sse/tst_alignedresourcesmanagers-sse.cpp
@@ -35,6 +35,7 @@ class tst_AlignedResourcesManagersSSE: public QObject
{
Q_OBJECT
+#ifdef __SSE2__
private Q_SLOTS:
void checkAllocationAndAlignmentMatrix4x4()
@@ -88,9 +89,14 @@ private Q_SLOTS:
// WHEN
Qt3DRender::Render::CameraLens *lens = manager.data(handle);
// THEN
+# ifdef __AVX2__
+ QCOMPARE(int((uintptr_t)lens % 32), 0);
+# else
QCOMPARE(int((uintptr_t)lens % 16), 0);
+# endif
}
}
+#endif // __SSE2__
};
QTEST_MAIN(tst_AlignedResourcesManagersSSE)