summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix animation local time calculation when changing playbackRateJuan José Casafranca2017-10-064-310/+180
| | | | | | | | | | Animation local time was computed in absolute mode, as a scale of the global time that has passed since the start of the animation. Now is computed relative to the last local time, as the last local time + a scale of the elapsed global time. Change-Id: I5c29002602a5184174618ac7755ec94f5c7a328f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Decompose a new quaternion rotation into euler anglesSean Harmer2017-10-061-0/+7
| | | | | | | Same as in QTransform. Change-Id: Ia1dca19c8faf996629ecbf8832e5625e7b22532c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2017-10-053-29/+48
|\ | | | | | | | | | | | | Conflicts: src/animation/backend/animationutils.cpp Change-Id: I6bd0d1d15da00537a0bb064fc828b2460584b8e8
| * Share the effect from the phong materialSean Harmer2017-10-033-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only loads the shader source once instead of 1000 times. Reduces the time to first frame by a further 30% by massively reducing the work the main thread has to do at startup. The Qt3DExtras material classes are convenient but lead to bad practices like this. We should provide a way to allow them to share the effect easily but still use the provided materials for their API. Perhaps a new ctor overload that takes a QEffect pointer would work nicely. Also fixed some float vs double vs int precision warnings as a drive by. Change-Id: I181de8d95841eb88c91c29ef6f45d215da079b98 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Share the mesh in bigscene-cppSean Harmer2017-10-033-8/+12
| | | | | | | | | | | | | | | | No point loading the same data 1k times. Shaves 35% off the time from application start to first frame being complete. Change-Id: I8cd7c8a5aa377c0663c03e35d7a4c03f50b052f6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Use qFuzzyCompare for rotation anglesSean Harmer2017-10-031-2/+2
| | | | | | | | | | | | | | Fixes clang warning. Change-Id: I1831bd112c33cdd1fe9cc7ae169cfba05cb8a694 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Don't send change notifications for unneeded propertiesSean Harmer2017-10-031-0/+4
| | | | | | | | | | | | | | | | | | The backend doesn't need to know about the rotation angles used to update the transform. Saves about 3% of time on the main thread related to mallocing the property change notifications. Change-Id: I784baf705cdd697ba860dc7a0c2e0e1c9ee467ec Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Extend skinned mesh manual test to use an animatorSean Harmer2017-10-038-5/+4722
| | | | | | | | | | Change-Id: I890abe966ba617f23a07137c6347fafac97ab591 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Extend buildPropertyMappings to support skeleton mapping use caseSean Harmer2017-10-031-40/+124
| | | | | | | | | | Change-Id: I2eaf725022f5044d7faf647f8789e73de969d49b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge branch '5.9' into 5.10Sean Harmer2017-09-309-96/+448
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/animation/backend/animationutils.cpp src/animation/backend/animationutils_p.h src/render/geometry/qmesh.cpp tests/auto/animation/animation.pro Change-Id: Ifb57bfb0b12b3ebf9ee177d4ea684134455b4143
| * Remove unused buildPropertyMappings() overload and testsSean Harmer2017-09-291-72/+1
| | | | | | | | | | | | | | Everything goes through the other overload now. Change-Id: Id0c196a6967a9f83e47092ca1fc7f4ab4ebe9309 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * Add unit test for FindRunningClipAnimatorsJobSean Harmer2017-09-295-1/+340
| | | | | | | | | | | | | | Should pass before and after the refactoring. Change-Id: I9ef8f948f03a131546fc6485e9c66494ff383714 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add convenience function to ChannelMapper to return list of MappingsSean Harmer2017-09-271-2/+34
| | | | | | | | | | | | | | | | Caches the resolution of node ids to ChannelMappings. Updated test to check this new feature. Change-Id: I0c2f539c2bd91e7918b98c5b60c9ca486b63ec08 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Ensure meshName gets used in the functorSean Harmer2017-09-271-0/+28
| | | | | | | | | | Change-Id: I9015546607b5663f1feada64bc03cb73d3538ef2 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Actually get matching clip indices for componentsSean Harmer2017-09-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | Rather than assuming they are in order. The blended clip animator code path now behaves the same as the simple QClipAnimator in that it can handle clips with channel components not in the expected order. We can now look at making both share a common code path. Change-Id: I61848e07b4f418ba9f4c56f56f4f49c9a5fbd588 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Fix gathering clip value node idsSean Harmer2017-09-262-4/+14
| | | | | | | | | | | | | | | | This correctly handles the case where the blend tree consists of a single value node. Added test case to catch it. Change-Id: I8982d2081748866d163f107a4513bd2d17feb83a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Deprecate QBuffer::typeKevin Ottens2017-09-222-25/+1
| | | | | | | | | | | | | | | | It can also be removed from the backend class, now the renderer doesn't look at it anyway. Change-Id: I5643922dccc81c0ee33f80e4b0ea34b63e51d89c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge branch '5.9' into 5.10Sean Harmer2017-09-1215-829/+207
|\| | | | | | | Change-Id: Id6a3d4ec579a2f2a2e559c22a2293d0e184f0bdf
| * Fix crash on surface selector unit testMike Krus2017-09-121-2/+2
| | | | | | | | | | | | | | | | Change order of local variables affecting the destructions order and making sure window outlives the surface selector Change-Id: Ia04f110656f4cc563643fb056ae491ffadf3a8b4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix bounding sphere pickingMike Krus2017-09-123-0/+183
| | | | | | | | | | | | | | | | | | | | In some cases, the list of pickable objects may contain entities that don’t have an object picker (or not parent has). Now filter the pick results to only keep entities which either have an object picker or are children of an entity that does. Added unit test which now passes Change-Id: I930c3d60cf2d19e845fe6c0de904c53b93ebe8be Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Get rid of the AllocationPolicy template argument in the ResourceManagerLars Knoll2017-09-114-10/+4
| | | | | | | | | | | | | | We always use the same policy anyway. Change-Id: I3349b8c19ce0e6239b140dfac7ba66f8dda1b9be Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Get rid of the HandleManager classLars Knoll2017-09-116-347/+2
| | | | | | | | | | | | | | | | | | Instead, direclty use the Allocator to acquire and release handles without an additional indirection. This removes around 30% of the overhead in run(). Change-Id: Ic4a9343dd52a900eb1c7eb6b4135bc7670076df1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Remove ArrayPreallocationPolicyLars Knoll2017-09-114-472/+12
| | | | | | | | | | | | | | It's not used anywhere Change-Id: Id65ec9fc8e38697c0dbd23fe4f816e1637a22483 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * GraphicsHelperGL2: Remember to set raw byte sizeKevin Ottens2017-09-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | If one ended up with this helper then the applyUniform would lead to a divide by zero for any type. As a side-effect, the support for more matrix types needed to be done for unit tests to keep passing. Change-Id: I66c8a2eb7e5617f2fed96c689cb4ebc024ef9853 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add sceneChangeEvent to QClock backend nodev5.10.0-alpha1Juan José Casafranca2017-09-081-0/+29
| | | | | | | | | | | | | | | | QClock backend node didn't implement sceneChangeEvent, so there was no communication from frontend to backend node. Change-Id: Idf72cba7b7c1834d80694d28a6df4826f8e279aa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Implement enabledLayers on ShaderBuilderKevin Ottens2017-09-041-0/+90
| | | | | | | | | | | | | | | | This is the backend counterpart to the QShaderProgramBuilder introduction of the enabledLayers property. Change-Id: Iecec5e9d1450c454f64c243f5f797c0d63e5f1ee Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Introduce enabled layers to QShaderProgramBuilderKevin Ottens2017-09-041-0/+56
| | | | | | | | | | | | | | | | This will allow to control the code generation by forwarding this to QShaderGenerator on the backend side. Change-Id: Ic613467ba742c05344ef553eabab861b2408d0ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Extend generateClipFormatIndices() to handle jointIndexSean Harmer2017-09-023-0/+1450
| | | | | | | | | | | | | | AnimationClip now matches on name and jointIndex if jointIndex is valid. Change-Id: Id2b3f41bf465a847048537583fc244743c0d026b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Extend checkAssignChannelComponentIndices test to cover indexed targetSean Harmer2017-09-021-0/+29
| | | | | | | | | | Change-Id: Ic2cd9504c454b96037ce2fcc061b4d38d2f0c2fd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Extend buildRequiredChannelsAndTypes to handle indexed targetsSean Harmer2017-09-021-0/+42
| | | | | | | | | | | | | | | | | | | | | | Specifically, this is needed for animating joints of a skeleton. If we later find other such indexed targets we can rename the jointIndex member to something more generic. For now this naming helps with reasoning as there are many kinds of index in play within the animation system. Change-Id: I348f255ee622aa11f26e5a3c1055bf5c12071c17 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Mirror QSkeletonMapping properties to ChannelMapping backend nodeSean Harmer2017-09-021-0/+30
| | | | | | | | | | Change-Id: Idb6aa59ae65351d8aa8bca31dd68a350bcb46973 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add QSkeletonMapping to Qt3DAnimationSean Harmer2017-09-023-1/+189
| | | | | | | | | | | | | | Allows to easily map animation channels onto a target QAbstractSkeleton. Change-Id: I53c348fe19e00f7b57653f5525b67920319f83d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Create backend nodes for any QAbstractChannelMapping subclassSean Harmer2017-09-021-2/+5
| | | | | | | | | | | | | | | | | | | | Introduces a new creation change type to distinguish between the frontend node triggering the creation. Following commits will add the new channel mapping types and populate the backend node appropriately. Change-Id: I09b3cbcd3d716c9e9c18873066b9f282222ab783 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge dev into 5.10Frederik Gladhorn2017-09-021-78/+30
|\ \ | | | | | | | | | Change-Id: I1bef655947a7176f7931c7f1b8ed4c4176395451
| * | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-09-011-78/+30
| |\| | | | | | | | | | Change-Id: Ic4220f9957266c374f751d3612c60b81e9cea193
| | * VSyncFrameAdvanceService: don't use timers in unit testsMauro Persano2017-08-311-78/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unit tests for VSyncFrameAdvanceService rely on somewhat strict timing and may fail under certain loads. This patch replaces timers with a semaphore to synchronize between threads. This also makes the unit test closer to actual Qt3D code, where there's a semaphore in the renderer to synchronize render view submissions. Change-Id: Ie328cdee1b3a0c2ad17f02d4f14e57e218556061 Task-Id: QTBUG-62825 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Fix signed vs unsigned comparison warning in unit testSean Harmer2017-08-301-2/+2
| | | | | | | | | | | | | | | Change-Id: I9c6b3a31daeb1ea133e01b5dd9cd071dd6685487 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Remove duplicate SUBDIRS entry from manual testsSean Harmer2017-08-301-2/+1
| | | | | | | | | | | | | | | Change-Id: I6f3de6e15a77695fea0cea1bc38ffc7c21607897 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Send joint names and local poses from render to animation aspectSean Harmer2017-08-303-1/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow the animation aspect to easily update the local poses of all joints in a skeleton without needing to be able to address any frontend QJoint objects. Change-Id: Id2137f2533702387dc68296aba1dd8627b0599d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Factor out local poses into their own vectorSean Harmer2017-08-301-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | To make it easier and more efficient to send all the local poses for a skeleton between aspects. Change-Id: I68bf374a7d466f606f8979fdbf84cb697a47a8a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Add name property to QJointSean Harmer2017-08-301-4/+14
|/ / | | | | | | | | | | | | And set it from the backend when creating frontend joints. Change-Id: I26d37c7f516944eb353af38716aab4c55bd2f79f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Remove alignment tests that should not be present yetSean Harmer2017-08-252-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When splitting the SIMD series, commits 0f1586e66d21af972caf353ad90f29b43721921b and e881d3ca08da399640ca310ec9f8e1c71aefe352 accidentally included tests for memory alignment before the custom operator new functions were added that ensure alignment. This obviously fails sometimes when the default operator new happens to not align the memory as the test expects, leading to crashes. This commit removes the tests. They will be readded along with the commit that introduces the custom operator new for the SIMD enabled types. Task-number: QTBUG-62781 Change-Id: I30cd88019cd7aef96b022530b81c3b46cd249207 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | BlitFramebuffer framegraph nodeJuan José Casafranca2017-08-2314-2/+1047
| | | | | | | | | | | | | | | | This node allows to copy the content from one FBO to another or to screen Task-number: QTBUG-58162 Change-Id: I6016c46d9d538a012c2f641116ed766dd70ad021 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | tst_graphicsapifilter: register signals typePaul Lemire2017-08-221-0/+7
| | | | | | | | | | | | | | | | This prevents warnings in the test and ensures the signal spies listen for the correct signals Change-Id: I3eecb3015ec39e1d01c319a436885bd4210405c1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge branch '5.9' into devSean Harmer2017-08-1949-139/+1751
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp src/render/backend/renderview.cpp src/render/graphicshelpers/graphicscontext_p.h src/render/graphicshelpers/graphicshelperes2_p.h src/render/graphicshelpers/graphicshelpergl2_p.h src/render/graphicshelpers/graphicshelpergl3_2_p.h src/render/graphicshelpers/graphicshelpergl3_3_p.h src/render/graphicshelpers/graphicshelpergl4_p.h src/render/graphicshelpers/graphicshelperinterface_p.h src/render/jobs/pickboundingvolumejob.cpp tests/auto/animation/clipanimator/tst_clipanimator.cpp tests/auto/auto.pro tests/manual/manual.pro Also disabled the QQmlMetaType codepaths following commit 49a11e882059ee1729f776722e085dd21d378c36 in qtdeclarative. The QQmlMetaType codepaths will be re-enabled once a qt5.git integration has succeeded. Change-Id: Ia654d75425e6d406c472d19864383612208cad2b
| * VSyncFrameAdvanceService: fix Scene3D renderingPaul Lemire2017-08-111-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering with Scene3D it could be that doRender() is called a lot more times than the speed at which the Qt3D simulation loop is running (this happens when resizing the window) This results in vsyncFrameAdvance->proceedToNextFrame() being called while the simulation isn't in a waiting state (simulation loop not yet blocking on vsyncFrameAdvance->waitForNextFrame()). This means that when the simulation loop finally unlocks, it would be able to make several loops for a given frame. Obviously this is really dangerous as the simulation loop drives the synching of changes and this could result in the data being prepared by the render jobs and the actual data in the managers to be corrupt. To fix that, vsyncFrameAdvance->waitForNextFrame() now acquires all available resources + 1 to cope with proceedToNextFrame being called more than once. Obviously this doesn't happen when Qt3D drives the rendering and the VSyncFrameAdvanceService was adjusted to have different behaviors depending on whether we are rendering with Scene3D or not. Change-Id: I495779571256d132fa7e1b3b31114f737de35a71 Task-number: QTBUG-60613 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add QRenderState unit testWieland Hagen2017-08-033-0/+313
| | | | | | | | | | | | | | Backend nodes should receive frontend proeperty changes Change-Id: I19ba70d08de833aab467a51d5b21553f0b602ec6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add private module qt3dcoretestSean Harmer2017-08-036-0/+365
| | | | | | | | | | | | | | | | Static library containing helpers for unit tests to avoid having to build the same files 200 times. Change-Id: I89d63abbd7777a96276154298c2748e2d6774514 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Fix deferred-renderer-qml lightingWieland Hagen2017-08-024-63/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The lights must be part of entities that are actually included in the final scene effect layer. So the light world positions have to be forwarded from the actual scene entities to some "dummy" light entities that exist just for the final scene effect render step. Also correct model / modelNormal matrices must be used for global normal/position calculation in the GBuffer render step. Task-number: QTBUG-46707 Change-Id: I380d2e2ecb008ab0606dcd36cd5d98dd1ec41ba6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * deferred-renderer-qml example: add all .qml files to projectWieland Hagen2017-08-021-0/+2
| | | | | | | | | | Change-Id: I9add67acbfab26c78c137753bb6b81865bf0abcf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>