summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Temporarily disable some benchmarks which fail to build on MacPaul Lemire2021-08-051-1/+2
| | | | | | | Change-Id: I1e4ecb5064a0118e295df9d2a256eb60b569ea5e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit f52098f08a3c14e5dfa366a7955aeafa93a1dc3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tests that have to run with opengl backendPaul Lemire2021-07-292-0/+10
| | | | | | | Change-Id: Ia7e3b84667d78f45195702fc131f0d3d88d1c7e7 Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit c154dc6d74b55a003fe620abf3a11a592e88462f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix for QShaderNode fix that selected highest version number of a rulePaul Lemire2021-07-291-2/+2
| | | | | | | | | | | | The rule selection still has to be made from last added rule to first so that format.support works correctly. - Update QShaderNode unit tests Change-Id: I47af898ee0d82e91009efccf1dca9937feaca717 Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit 21168905a7eda8806543b490a0fae5a5a0ec7cad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_aspect following rerun of BV jobs when entity enabled changedPaul Lemire2021-07-291-0/+4
| | | | | | | Change-Id: I067f5861767a7d2cdf078d9a1c04e8721e5f7008 Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit dfed3541b736d52ed3693835be4b2ce86fbc1d52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix BV tests following changes in BV propagationPaul Lemire2021-07-293-18/+27
| | | | | | | Change-Id: Ifa53378c930b071231dab3d293e8bb1ed4c71b46 Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit dc695bf1485fb1620fb258d57d87916b94d7c95a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change bounding update propagationMike Krus2021-06-211-5/+5
| | | | | | | | | | | | | | | | Previously, bounding computation results from the core aspect were propagated to the render aspect via the front end objects. This introduces a job watcher which gets called with the results and the render aspect can update it's backend data directly. The watcher process method is called in the thread of the core aspect job but the render aspect job will wait for that complete anyway (since it depends on the core aspect job). Change-Id: Ie59337f00025fd55fc723a7d105342e0b1e91d6c Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit e378ebd0db6c06af7709498122912284852e6bc9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Partially Revert "Remove custom gltf tool"Mike Krus2021-06-204-0/+308
| | | | | | | | | | In b9994cd88925ca012d66e52d033cc9a3a909fc7a, we removed the tool and the parser. This restores the parser, but the tool was unmaintained. Change-Id: I168e720b7fdf65aafebb9652933d8093f5449bdc Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 3c02825fcedbdb0983775d0522af9c851be6c0cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build of manual testsMike Krus2021-06-195-13/+13
| | | | | | | Change-Id: I4b8e1b3c5e2a8b942441a0889087330a7e1edff1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 0409b7c33048461408112a06cd10b9a13f018cc6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix multi-view pickingMike Krus2021-06-143-2/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Scene3DView, qt3d still has a single scene graph and and a single framegraph. It automatically creates layers and layer filters to make sure the right objects are only rendered in the right view. This affects picking though as it was not aware of layer filters. This patch collects the filtered layers for each view and makes sure only entities matching those layers are tested for picking (this uses code that existed for ray casting). This changes the behavior of Qt3D though as non rendered objects (ie, excluded by layer filtering) are no longer pickable. Only way now would be to provide a shader that just discarded everything. Note: Scene3DView is not available in Qt6 so on this branch this only really affects custom scenes with multiple views each showing different content. [ChangeLog] Non rendered entities (due to layer filtering) are no longer pickable Ticket-number: QTBUG-94214 Change-Id: I8515368e43342b33ac219dff533e92efa72fbe7d Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit d79376732105dea749e71cdb114251084c7138a9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix error when configuringKai Köhne2021-04-291-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The benchmark, manual folders is already added to the build in Qt6BuildInternalsConfig (depending on whether QT_BUILD_BENCHMARKS , QT_BUILD_MANUAL_TESTS are true). Adding it manually again leads to errors like The binary directory C:/dev/qt/6.1/msvc-2019-amd64-toplevel/qt3d/tests/benchmarks is already used to build a source directory. It cannot be used to build source directory C:/dev/qt/6.1/src/qt3d/tests/benchmarks Specify a unique binary directory name. This reverts part of 8448855b8050e56 Fixes: QTBUG-93240 Pick-to: dev Change-Id: Idc5b2fea6996cd8367f0963e993dd788dd3fb239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix detection of VulkanMike Krus2021-04-201-1/+2
| | | | | | | | | | | | | | | | | | | | | When Qt is built to enable Vulkan support, it is given the path to the Vulkan header source. This then enables the vulkan feature. Qt3D used this feature to decide if it could use Vulkan directly or not, however, since it is now built separately, it has no idea where to find the headers, so QVulkanInstance is not properly defined. This caused an issue when using official installers of Qt since those are configured to support Vulkan. So we now do a separate config check to find Vulkan for Qt3D. When building Qt3D, you need to make sure if can find Vulkan (the same way you configure Qt itself) Task-number: QTBUG-90243 Change-Id: Ia05381597b4974d7b0914706ea2f607341dccacc Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 9a473a3c9b246f4895ae73d7060745b8b199a6c5)
* ObjectPicker: ensure pristine pickers are handledNicolas Guichard2021-02-261-0/+15
| | | | | | | | | | | | | | When adding a QObjectPicker component to a QEntity, the object couldn't actually be picked until one of hoverEnabled, dragEnabled or priority changed. This fixes the issue by ensuring notifyJob is called at least once, when the picker is initialized. Change-Id: I5b035cf5be6ef1da35c2d24cf76bc2daaad9bc57 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 1641eae01636ddb82b668c4f91d2c26f89e5bc06) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Minor fixes to compile against 5.15Paul Lemire2021-02-018-5/+32
| | | | | Change-Id: Id9574cf23b9af29815d8452915cebfc380fd94d1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update QtQuick API to build with 5.15Mike Krus2021-01-113-4/+13
| | | | | | | Haven't tried to run anything, it just builds Change-Id: I6c2c2a949bc3892a363697cf38f1608af87c303c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Handle changes in QMetaType APIMike Krus2021-01-082-4/+21
| | | | | | | Updates to support building with Qt6 and Qt5.15 Change-Id: I9f06d810c943a348e6a060f4ea35ed870f21694a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Enable compiling non-QML API against Qt 5.15Mike Krus2021-01-053-4/+7
| | | | | | | | | | | | Built with QtQuick disabled. - C++17 required - minor issues with QList vs QVector - QMutexLocker templated vs not - moc forward declaration handling Change-Id: I5540625e74e2c009e528f56203e4b88be8d54599 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Restore use of QVector in private APIMike Krus2021-01-0517-218/+218
| | | | | | | | Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix broken test for shader builderJim Albamont2020-12-171-1/+1
| | | | | | | | This test needs to be updated to match the fix for change I3fefbe93b58c8bc695a15022204806abcc5ff127 Change-Id: I2a3975508d89b76be53c851f937f40139d676d0c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix binding of CubeMapArray texturesJim Albamont2020-12-111-0/+107
| | | | | | | | | | | | | | To bind to a specific face: use glFramebufferTextureLayer and calculate the layer as 6 * layer + face. To bind to a specific cubemap: There is no way in OpenGL to directly bind to an entire cubemap within the array. Instead bind to the entire texture as for a CubeMap with AllFaces. It is up to the drawing code to select the right cubemap and face, 6 * layer + face Change-Id: Ib9e1a598503eeba1fa729677944aba6d799f90b2 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix disabling shader cache via environment variableJim Albamont2020-12-101-0/+2
| | | | | | | | | | | | The tests were a broken too because the QT3D_DISABLE_SHADER_CACHE environment var was still set from the previous test. These tests passed before because the shader builder used the cache if either the QT3D_DISABLE_SHADER_CACHE or QT3D_REBUILD_SHADER_CACHE are not set. Change-Id: Ic04bf3bb8bb7b9b27e3dc9663fe5e96647a3bed4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit fd5c3299553818e99421f54c1b819681335de9aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't include the world for testsMike Krus2020-12-0932-32/+37
| | | | | | Pick-to: 6.0 Change-Id: Ib87186571dbf911004d8292e0c0cd9ddaea92318 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix deadlock when running with QT3D_MAX_THREAD_COUNT=1Paul Lemire2020-12-012-4/+4
| | | | | | | | | Also remove duplication and make QAspectJobManager::idealThreadCount the centralized function to retrieve expect maximum number of threads. Pick-to: 6.0 6.0.0 Change-Id: Iec8d65d368ac7825ef87e883a987551726603adc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI: restore QBufferCapture featurePaul Lemire2020-12-016-10/+104
| | | | | | | | | Also fix manual test to import Qt3D.Core 2.9 since QBuffer was moved to core in Qt 6 and accessType property was introduce with revision 9. Pick-to: 6.0 Change-Id: I449f413fd161fe4660cef61708cd641e429c1c81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Handle changes in OpenGL classesMike Krus2020-11-273-2/+20
| | | | | | | Support building against both 5.15 and 6 Change-Id: I46e15f2f898f5f2304075e290798d3d2aea47dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use RHI's clipSpaceCorrMatrix for backend where Y is not upPaul Lemire2020-11-262-0/+8
| | | | | | | | | | | | | | It's better to rely on RHI instead of a hard coded matrix. Also modify the UBO to provide the clipSpaceCorrectionMatrix and the uncorrected projectionMatrix. All the other matrices we compute and provide use the corrected projectionMatrix but these two new matrices give users the libertity of bypassing the correction if they need to. Pick-to: 6.0 6.0.0 Change-Id: I52e409cc9b38ea0e939d19d92e2ddd907aa7d1cb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAbstractTexture: expose mipLevelPaul Lemire2020-11-242-0/+48
| | | | | | | | | This is supposed to be exposed for Qt6 Pick-to: 6.0 Pick-to: 6.0.0 Change-Id: I3fefcd706ca16328946f33d665055dfe2a4c3563 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Rename more test targets conflicting with qtbase onesKai Koehne2020-11-2420-18/+201
| | | | | | | | | Fixes: QTBUG-88790 Change-Id: I886592001ed2d8aad8ab6df542ea788b44d2ff71 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e4cd93bcad4953e95f5bc6f3d35502a604f2ec97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle fallout from QEvent loosing it's copy constructorMike Krus2020-11-232-572/+650
| | | | | | | | Task-number: QTBUG-88757 Change-Id: I5097faecd2e895d4685a4cc57a4e2a5c079f2255 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit d826238b65b0ebd8034900224b382bd85e6add27) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Introduce QGeometryRenderer::sortIndexMike Krus2020-11-202-0/+24
| | | | | | | | | | | Lets user override the sorting order of entities. [ChangeLog] Add sortIndex property to QGeometryRenderer to explicitly control the order in which entities are rendered Pick-to: 5.15 Change-Id: Iab7fd0d705f7ddcb424a59f86f8c2c28059813d1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix deprecated API usage and compile warningsMike Krus2020-11-2014-157/+154
| | | | | | | | | - QVariant::Type deprecated, use QMetaType related APIs - QNodeId not used as reference in for loops (nop but really noisy) - some unused code Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Follow up on change of QQmlListProperty to qsizetypeMike Krus2020-11-203-0/+7
| | | | | | | | | Also update dependencies and fix non-gui builds. Disabled (for now) gltf unit test since JSON parser seems to crash. Change-Id: Ie7fdd9626653e89ad43e8bdb22b0e764618b1e9e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix GLTexture cleanupPaul Lemire2020-11-045-1/+163
| | | | | | | | | | The GLTexture class wasn't registered for cleanup on the manager. This could result in it being reuse while not being reinitialized resulting in incorrect rendering. Change-Id: I85e6a5c3b5ca9d3cfa5ac5bcb1db3695dabfa576 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Handle invalid entity names in QSceneLoader::componentMichael Brasser2020-11-021-0/+7
| | | | | | | | Return nullptr rather than crashing. Pick-to: 5.15 Change-Id: Ie11fe798e0bcd3bfdfda053331eabf9ed16e3d94 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix resource path for 3dcore testPaul Lemire2020-10-291-1/+1
| | | | | | | Windows doesn't like colons in a path. Change-Id: Ia5e8da4e45bf8e99600eb8ab0bcd610fa5e2ad64 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add caching mechanism to ShaderBuilderPaul Lemire2020-10-281-2/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a 2 level cache system: runtime and offline First we now generate a hash key based on unique features of a graph, the api it targets, the last time the graph file was modified. We then use that hash key to at runtime check whether we have already loaded a graph matching the same hash key. If that's not the case, we switch to using the offline cache and checking whether a file already exists for that shader or not. If the file exists, we load it, use the code it contains and add it to the runtime cache. If the file does not exist, we revert to actually generating the shader and we save the generated code to both the offline cache and the runtime cache. By default, the offline cache with try to write into the location reported by QStandardLocation::writableLocation(QStandardLocation::TempLocation). Optionally, the environment variable QT3D_WRITABLE_CACHE_PATH can be set with a path to a writable location. If QT3D_REBUILD_SHADER_CACHE is not empty, cache will be regenerated. Alternatively if QT3D_DISABLE_SHADER_CACHE is set, cache will be ignored. Pick-to: 5.15 Change-Id: Ia348f92ce4cdd5e63ec89e58b7954d1f127f26bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make QAbstractFrontEndNodeManager privateMike Krus2020-10-273-3/+3
| | | | | Change-Id: Ic12bc80a00e887a959c6cb27e72be0422d71b254 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Pass the raw data to the texture data extractorJuan José Casafranca2020-10-271-23/+1
| | | | | | Change-Id: If6ca151b22f442985df1ff34108ca0bd216ebf47 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 6fdf835639e56c68ae01da894c7d2b9f552dd87d)
* Expand QPaintedTextureImage documentationMichael Brasser2020-10-221-0/+2
| | | | | | | | Also make use of the newly documented pattern in the manual test. Pick-to: 5.15 Change-Id: Idefe271eea345848af3817e08ac5b45946843dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename test targets conflicting with qtbase onesKai Koehne2020-10-082-1/+23
| | | | | | Task-number: QTBUG-87217 Change-Id: I2c6f2e0af475d03baa74799a61d70c603fd2ce85 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use internal CMake APIMike Krus2020-10-07337-517/+517
| | | | | | Task-number: QTBUG-86815 Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make DebugOverlay accessible from QMLMichael Brasser2020-10-021-0/+2
| | | | | | | | Register and document QDebugOverlay. Change-Id: I357918ce3448c451d796f88656ec287bf03ffcfd Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix a crash when node is added and destroyed immediatelySean Harmer2020-10-011-0/+47
| | | | | | | | | | | | | | When a node is added to the scene it is scheduled for a post-creation initialization. However, if the node is destroyed before this post-creation queue has been processed we will crash. This commit ensures that the node being deleted is removed from the post-creation queue. Usually the queue will be empty and so this should not add a performance penalty. Pick-to: 5.15 Change-Id: Ibe4289e1e54cdb145f8588f15dc4ad894e427582 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Allow to specify a functor to extract data from QTextureImageDataJuan Casafranca2020-09-281-0/+11
| | | | | Change-Id: Idd052f6c24665a1accd2cd681c80fe74846e5c39 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Allow to set alignment requirement for an imageJuan Casafranca2020-09-281-0/+1
| | | | | Change-Id: Ifffbfd80a3d99b43e348e12bea62e3c90eed80c4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix animation not runningMike Krus2020-09-253-8/+9
| | | | | | | | Previous fix for compile issue forgot to account for the fact that the data changes after being registered with the class. Change-Id: Ice5238221f190f758ec3f25d883c56877c185e1c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QNodePrivate::registerDestructionHelper for std::vector containersPaul Lemire2020-09-231-9/+191
| | | | | | | | | Ideally should support generic containers but clang seems to fail to generate the symbol on the mac. Change-Id: Ic1d6d815ab9aff60a97b3b0047228f55d7efe158 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove deprecated API from custom-mesh manual testsPaul Lemire2020-09-182-4/+0
| | | | | Change-Id: Ie7272b6d18b0da535b657041bbde81b1e4e6334a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderGenerator: add a #define LAYER_name for each layerPaul Lemire2020-09-181-0/+36
| | | | | | | | | This will make it more convenient to insert conditional code based on whether a layer is defined or not. Change-Id: Ia72b569f022dd2ee723bf2493710eab709042639 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix build with latest QtBase and QtDeclarativeMike Krus2020-09-072-4/+4
| | | | | | Task-number: QTBUG-86410 Change-Id: I26427d65de72c86f952b076259979f90eaef87f4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QCoreSettings classMike Krus2020-08-273-4/+4
| | | | | | | | Adds the ability to disable bounding volume updates from the core aspect. Change-Id: I6d8a4c6f8fd880c9fca015cd40eaf7316747a2c6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>