summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Allow for when a Scene3D item switches screens"Paul Lemire2020-02-185-300/+0
| | | | | | | | | This reverts commit 648b7459e8a6ce8ce1f115a14da63d546b743439. Reason for revert: Introduces QTBUG-82275 Change-Id: I5514ad58707c086eaaab3203773614c939e461e8 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Destroy FBOs when RenderTarget node is destroyedPaul Lemire2020-02-131-0/+42
| | | | | | | | It appears we never destroyed FBOs which lead to bugs when destroying and recreating a RenderTarget Change-Id: I99b3df95b821670aa3bbd63209ff9bcc21afbf79 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Allow for when a Scene3D item switches screensAndy Shaw2020-02-075-0/+300
| | | | | | | | | | | | | | | When a Scene3D item switches screens then it will need to be reinitalized so that the supporting contexts, offscreen surfaces are set to use the same screen and not the original one. This ensures that the item is still rendered correctly on the new screen. This includes a manual test using QQuickWidget in separate windows that enables it going from one screen to the other. Fixes: QTBUG-79192 Change-Id: Id5bbc0d30d04ea4a945463238868b68283df0543 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix stale Entity cachesPaul Lemire2020-01-312-12/+37
| | | | | | | | | | Make sure we mark the internal state as dirty when Entities get cleaned up. We could otherwise end up with stale caches referencing Entity's that have been cleaned up (referencing null bounding volumes ...) Change-Id: Ia2d2c67f8635e28690f33c0a7d4c9ff1de0eb471 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix usage of C++14 featuresMike Krus2020-01-141-0/+4
| | | | | Change-Id: Ibd460eceafdd29d7d88ac2418496dc7002de1095 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use animation rather than event to drive simulationMike Krus2020-01-131-0/+6
| | | | | | | | | | | | | | | Using events can be problematic as they contribute to flooding of the event queue leading to issues with running animations. So we now use an actual animation which runs in a loop and triggers every 1ms (rendering still vsync locked though). If animation have not been enabled for the qt build, we fall back to using events as before. Tests were changes since frame progress is no longer driven by events, so processEvents does not trigger a frame update. Change-Id: I89b11862ef432dffae0c3dfb140eedd61754697e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.14.0' into 5.14Qt Forward Merge Bot2019-12-131-1/+1
|\ | | | | | | Change-Id: Ibf5f508eec94be4bae2df3ce2e1511de696dcd72
| * Fix OnDemand rendering with Scene3Dv5.14.0-rc2v5.14.0Paul Lemire2019-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using OnDemand rendering, Scene3D would lock if nothing in the scene were to change. By being blocked, it would also not process jobs for other aspects (input, logics). That would prevent things like a CameraController from running, which in turn would make it impossible to move the camera and trigger a change in the scene to request rendering. Additionally, Scene3D would ignore whether the Qt3D renderer actually needed rendering or not as it was watching on its own the changeArbiter for changes to decide whether rendering was required or not. This would ignore the case where Qt3D needs multiple frames to render a correct frame (e.g loading buffers, shaders at frame n, rebuilding commands at frame n+1) Scene3D now asks the Qt3D renderer by calling the shouldRender() function to decide whether rendering is needed or not, in addition to watching the changeArbiter. Regardless of whether rendering is needed, it now let each aspect process jobs. This ensures things like FrameAction/Input are processed. Then, Scene3D decides whether full rendering is required or whether it only has to be called to allow the Qt3D simulation loop to proceed for the next frame. If the latter, it does it so as not to have QtQuick trigger a redraw. Change-Id: I870f773c224286d6b7ec0f6045319e51e09cbf8e Task-number: QTBUG-80521 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Fix picking with primitive restart for line loopsMike Krus2019-12-131-6/+21
| | | | | | | | | | | | | | | | | | | | Previous fix was not closing the loop on every primitive, just the last one. Task-number: QTBUG-71919 Change-Id: I22d52258477b0c4777118ee36a0b3868da982885 Reviewed-by: Volker Enderlein <volker.enderlein@ifm-chemnitz.de> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Skip shouldNotCrashInNormalStartupShutdownSequenceUlf Hermann2019-12-111-0/+4
| | | | | | | | | | | | | | | | | | | | The test is flaky on macOS 10.12 and 10.13. As it usually times out, a blacklist entry won't help. Blacklisting merely ignores the result, but doesn't prevent the test watchdog from killing the process. Task-number: QTBUG-80660 Change-Id: I6aec979e7437700e4e6596241f135622d99fd3be Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix picking with primitive restartMike Krus2019-12-091-6/+20
| | | | | | | | | | | | Task-number: QTBUG-71919 Change-Id: If7923fab6c43f5d7139d1bbdceb73c17bf489099 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Shader: record standard uniform at loading timePaul Lemire2019-12-041-1/+1
|/ | | | | | | | Avoids having to check for each uniform (for each frame, each geometry) whether it is a standard uniform or a user defined one. Change-Id: I76cff7869aacc1343a9acf991f8035b8118581ed Reviewed-by: Mike Krus <mike.krus@kdab.com>
* PackUniformHash to QVectorPaul Lemire2019-11-141-9/+4
| | | | | | | | | | | | | | | | | | | Surprisingly it's hard to notice its effect in the speed of execution, frame preparation looks to be more or less the same with the profiler. However with vtune, the profiling traces show a huge difference with QHash, mainly in time spent allocating memory. It shows a noticeable reduction in CPU usage. On bigscene-cpp with 600 entities QHash -> On a 158s run, CPU time is 112s (70%) free accounts for 26s (23%), malloc 24s (21%) QVector -> On a 190s run, CPU time is 110s (58%) free accounts for 5s (4.5%), malloc 4.7s (4.2%) Change-Id: I880d44b1acf7f051e479ed356864c3caf407f23f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* FilterProximityJob: only run it if our RV requires proximity filteringPaul Lemire2019-11-131-4/+10
| | | | | | | | Which is only very rarely required by user applications. Avoid useless memory allocations every frame Change-Id: I69ea73ebfffdbe928f99333b4d1dd90cf4ada430 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Uniform: use QVarLengthArray<16 ,float> instead of <4, float>Paul Lemire2019-11-131-1/+1
| | | | | | | | | | | | | This otherwise yield for lots of reallocations that could be avoided. The gains seem to be about 2/3% of cpu usage according the analysis with vTune. It does indeed mean that for smaller uniforms vec4, float, sampler we are wasting a bit of memory. The impact of this is likely to be unsignificant though. Change-Id: Id72c81a795bf9326ef48b170bb0806de9b430412 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix SharedTexture manual testsPaul Lemire2019-10-314-32/+12
| | | | | | | | | | Remove VideoPlayer thread, not needed and could yield to asserts if QOpenGLContext::makeCurrent is called from another thread than the one it was created with, depending on platforms and QApplication flags being set. Change-Id: Ic5d1858e5356b16293ee6298558dd7c60f3c86dd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Buffer: make sure we force allocate before doing partial updatesPaul Lemire2019-10-301-0/+55
| | | | | Change-Id: I229f9bcd21a10c0a4cff5c4f559cd285a3e50276 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Compute renderables/computables/lights once instead of once per RVPaul Lemire2019-10-292-62/+20
| | | | | | | | All RV end up using exactly the same vector before filtering it down on per RV specifics. No point in compute RV times the same thing. Change-Id: Ia674095627771c8e9ada090fa47623cbbbd8a3f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode::updateNode: ensure postConstructorInit of node is calledPaul Lemire2019-10-281-29/+77
| | | | | | | | | | | | | | | | | | | | | | When a QNode subclass is created doing Subclass(parent) with parent != nullptr QNodePrivate::_q_postContrustorInit is called through a queued invocation due to the fact that the QNode ctor is called before the subclass ctor is (and we need the class to be fully constructed to do proper initialization). When adding a QNode subclass created as described above, and immediately referencing it as a property of another QNode, we can end up in cases where the backend gets aware of the node being referenced in the relationship and tries to create its backend. Unfortunately due to the queued invocation of _q_postConstructorInit, the frontend node has yet to be fully initialized, resulting in the creation of the backend node to assert/crash. Therefore, when updateNode is called (whenever a subnode is referenced in a relationship) we now ensure that postConstructorInit gets (or has already been) called. Change-Id: Iea6e0b5a59c676f5db2946bec2f8c345accc32b0 Task-number: QTBUG-79350 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add manual test to check manual render loopPaul Lemire2019-10-253-1/+221
| | | | | | | | Shows that update are done before rendering takes place Change-Id: Ia3f5bcb497c023dad805609dcb1ffe9ce7947c06 Task-number: QTBUG-79375 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Scene3D: halt Qt3D simulation loop while not visiblePaul Lemire2019-10-255-1/+244
| | | | | Change-Id: I09d69fab7aaf3c2fa77da6eb30e505d9cb25c01f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* ComputeCommand: add unit tests for manual trigger modePaul Lemire2019-10-241-0/+118
| | | | | Change-Id: Ia106a235648df7232fbcaf4f61c880a9ab5491ef Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add manual test for QSubtreeEnablerPaul Lemire2019-10-247-1/+380
| | | | | | Change-Id: Iff354956c831919cbb9d58f75014be0fa92b45c4 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add manual test to check manual trigger mode on ComputeCommandsPaul Lemire2019-10-2411-0/+702
| | | | | Change-Id: I8048795277828ecba7d46dbc846685e606b2b8b9 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix post FF API changesMike Krus2019-10-223-7/+10
| | | | | Change-Id: I347f6df41c0a4f2295831e78248669b4a2d6b5ef Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renderer: build cache data for new RenderViewsPaul Lemire2019-10-221-1/+28
| | | | | Change-Id: I95690444badaf573b9e2775b50c61113de8d1c77 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* ComputeCommand/SubtreeEnabler use direct sync job to update frontendPaul Lemire2019-10-222-9/+26
| | | | | Change-Id: I773955df33f0b4dcdaa0953633761ff82f3d0da4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove remaining messaging code in QSkeletonLoaderMike Krus2019-10-222-129/+0
| | | | | | | And matching unit tests Change-Id: Iff0b13b2ad9ff07d08c767f4b20de2a1685a5570 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QMouseEvent: fix BIC issue following Modifier/Modifiers changePaul Lemire2019-10-223-1/+106
| | | | | | | | | Will have to be done only in Qt6 unfortunately. For now we abused the fact that an int is used to store the enum so that we store multiple Modifiers values into one Modifiers enum. Change-Id: Ib111140afbe07cfd62fcf3cb8e1a57d3ad848a89 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove old code from animation classes & update testsMike Krus2019-10-213-67/+24
| | | | | Change-Id: Ic91a4f168172d6f34d858488e6fc170e8ed875f9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Convent SendBufferCaptureJob to direct syncPaul Lemire2019-10-211-1/+1
| | | | | Change-Id: I8d5bc69cb75d73e628f08d70b2e40d665c39802b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Convert LoadBufferJob to use direct syncPaul Lemire2019-10-211-4/+1
| | | | | Change-Id: I44334264fba285494624a8a4ee6ff3b85755402c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Split RenderCommand generation and uniform updatePaul Lemire2019-10-213-162/+151
| | | | | | | | | | | | | | | | In most cases, we can generate the RenderCommands once and reuse them in subsequent frames only updating the uniforms. We still have to copy the RenderCommands as the renderer renders while we start preparing the next frame. This is still faster than regenerating them entirely. Regenerating the entire commands will happen only when FrameGraph or Scene structure changes. That should rarely be happening on a per frame basis. Next step could be to look at how to only update commands for Entity with Parameters that have changed. Change-Id: I202870850a46fcd3946f81bffddb7027d192f374 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up old property update codeMike Krus2019-10-2019-25/+0
| | | | | | | Remove useless includes, clear up commented out or unused code Change-Id: Id3382b16108d79f1e2522d43463c8d70aef8fcb2 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* FrameGraphNode: mark dirty on cleanupPaul Lemire2019-10-171-0/+18
| | | | | | | | Otherwise the FG cache is not rebuilt and we might have dangling pointers around. Change-Id: Id97de41092617acbf067fcac4cf7805c2eb715da Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Buffer: mark as dirty even if empty on firstTimePaul Lemire2019-10-171-5/+19
| | | | | | | | | | We otherwise assert in the case we create an empty buffer that is empty but referenced by Attributes. This is still a valid case as buffer data can be set later on. Change-Id: Ida198f5815f6cbb488b6b27436c4238146c3ae39 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* tst_ktxtextures: remove OTHER_FILES variable from .proPaul Lemire2019-10-171-28/+0
| | | | | Change-Id: I0db693461c282c7bcf8006c3094f50ea3f0a0eba Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add manual test for compressed_texturePaul Lemire2019-10-1637-1/+212
| | | | | Change-Id: I57111539631824f2b38f7a8e49d8ca80c189b376 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add unit tests for KTX loadingPaul Lemire2019-10-159-0/+115
| | | | | Change-Id: I3e80497d107329f250bd524a02157c6246e36e68 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Paul Lemire2019-10-152-18/+192
|\
| * Merge remote-tracking branch 'origin/5.13' into 5.14Paul Lemire2019-10-152-18/+192
| |\ | | | | | | | | | Change-Id: I44133fbc9b93e96918463b0b0891ee5ab7db9f2c
| | * Fix for bounding volume handling and calculationVolker Enderlein2019-10-012-18/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fixed Ritter algorithm implementation - Added notation of invalid bounding sphere (radius == -1.0) - Handle merging of invalid bounding sphere with valid ones - Added test cases and adjusted tests boundingsphere and proximityfilter - This is necessary to ensure the correct working for viewAll and viewEntity Task-number: QTBUG-78313 Change-Id: I1dc6d227cf9009f6fbd3230093c7a7a94fb05ae3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Update QScene2D to use direct syncMike Krus2019-10-141-29/+33
|/ / | | | | | | | | | | Change-Id: Iba2fa5ce9d295706fc50f904cac68f00bd8f02b7 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update PickBoundingVolumeJob to use direct syncMike Krus2019-10-144-360/+455
| | | | | | | | | | Change-Id: I7878294cd44872ccdc17515fbb44a6b2a99239e5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Convert Shader/ShaderBuilder jobs to use direct syncPaul Lemire2019-10-143-104/+78
| | | | | | | | | | Change-Id: Ia56ba6176c86e34904611ae57e682ac9d52c79f7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Update QAbstractTexture message handlingMike Krus2019-10-114-32/+18
| | | | | | | | | | Change-Id: I5c0ff05d405766b2e0aee992ee1c150b5a0cf059 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Clean QJoint message handlingMike Krus2019-10-111-43/+21
| | | | | | | | | | Change-Id: Ib09024017a2d213e50b3acc89d7c411728eb1869 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update LoadProxyDeviceJob to use direct syncMike Krus2019-10-114-57/+6
| | | | | | | | | | Change-Id: I6d49abd28a665f89096ec2baaa861490c071d3d3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update AxisAccumulatorJob to use direct syncMike Krus2019-10-112-79/+0
| | | | | | | | | | Change-Id: I4e64fa9f94dad1392b80851c2a6d8d4e013147f7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Convert LoadGeometryJob to use direct syncPaul Lemire2019-10-101-22/+0
| | | | | | | | | | Change-Id: Id744de2f10e7744ad5a9d4f425ae534153ed7446 Reviewed-by: Mike Krus <mike.krus@kdab.com>