summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* 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>
* Fix RenderCommand sortingPaul Lemire2017-08-021-2/+186
| | | | | | | | | | | | - Remove type punning mechanism that was used to filter previously (could lead to undefined behavior) - Properly filter based on shader and material - Add unit tests Change-Id: I8d0fd4a49d586e6ec26515e2cafe1ea94d38f8f1 Task-number: QTBUG-60183 Reviewed-by: Oleg Evseev <ev.mipt@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QSharedPointer::create() moreMarc Mutz2017-07-2222-62/+62
| | | | | | | | | | This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: none. Change-Id: Ic6368521ebf5841267ffe7917cc652627f7b26a7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RenderCapture: read back from the correct framebufferPaul Lemire2017-07-1711-9/+620
| | | | | | | | | | | Up until now, RenderCapture would read back from the back buffer. In cases where it's used within a RenderTargetSelector, it should instead read back from the ColorAttachment0 of the framebuffer. Later on we might allow to specify the ColorAttachment. Change-Id: I9ca94333184338b2fdb79c5c2668d5929ac8d405 Task-number: QTBUG-61547 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Fix Deferred-Renderer examplesWieland Hagen2017-06-278-20/+22
| | | | | | | | | | RGB32F and RGB16F will not work on some drivers. Shader variables must be initialized to zero, will flicker if not done. Task-number: QTBUG-56248 Change-Id: Iead5df1a607db80b733aefa73d7a59c8310a8d81 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Change manual tests using Scene2D to use TextureMaterialMäättä Antti2017-06-248-250/+6
| | | | | | | | | | Change render-qml-to-texture-qml and video-texture to use TextureMaterial. This removes the dependency to the render-qml-to-texture manual test from these tests. This also fixes the controls in the render-qml-to-texture-qml test, which were 'upside down'. Change-Id: I248014decd8f9d06b0e0922d035afe8c0b0f78ff Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix QRenderCaptureReply deallocationMäättä Antti2017-06-211-0/+21
| | | | | | | | Add deallocation guard and set parent of the reply. Task-number: QTBUG-61508 Change-Id: Ia299450d792b2254c2944472382c8241b271ebf6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* animationutils: Improve autotests for QColorLaszlo Agocs2017-06-191-0/+54
| | | | | Change-Id: I88e254c36e99a83a8e7bbc562b7a729a04ace28a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update NodeInstantiator's children on parent updateMauro Persano2017-06-163-0/+45
| | | | | | | | | | | | | | Currently the parent for elements created by NodeInstantiator are set to the instantiator's parent. This doesn't work for nested instantiators, since at the time the inner instantiator's children are being created the instantiator itself doesn't yet have a parent node yet. Update the parent of elements created by the instantiator when the instantiator's parent changes. Change-Id: I6f260ad2a8a81af5551799e6c643d8849f46e342 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Add support for linear interpolation in clip jsonLaszlo Agocs2017-06-143-0/+88
| | | | | | | ...and add an autotest Change-Id: I5c473f5f5918db9cc108f9966fe549e2cba374de Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix and extend animationutils autotestLaszlo Agocs2017-06-141-3/+32
| | | | | | | Test QColor and fix various issues and typos. Change-Id: I559fa9887f65d176bb4b7d678deab0b182d0b3a8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix animation inifinite loopingLaszlo Agocs2017-06-081-4/+4
| | | | | | | | Trigger also on -1, which is what QAbstractClipAnimator::Infinite is defined as. Updated tests to reflect this change. Change-Id: Ib33a5e9b58f48b3810a0238b7682e532e382c050 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* tst_QGraphicsApiFilter: Use application objectFriedemann Kleint2017-05-301-1/+1
| | | | | | | | Fix: ASSERT: "qGuiApp" in file kernel\qopenglcontext.cpp, line 1282 Task-number: QTBUG-61112 Change-Id: Id3162565aed5d03294f203f711eb712bbc08c06f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add reference count for backend buffersMauro Persano2017-05-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | In the main rendering loop, first dirty GL resources are uploaded, then render views are submitted, and then unused GL resources are released. Consider the following piece of code: entity->setParent(nullptr); entity->setParent(root); If this is executed inside a single frame, entity's children buffers will be marked for release when they are removed from the scene, and marked as dirty when they're added again. In the following frame, the render thread will upload them at the beginning of the frame, and incorrectly release them at the end of the frame. This patch adds a reference count for buffers in BufferManager to prevent this kind of race. The reference is incremented when a buffer is added to the scene (in Buffer::initializeFromPeer) and decremented when it's removed from the scene (in BufferFunctor::destroy). Task-number: QTBUG-60726 Change-Id: I8eed7b4c2d8262ba846e73bf4299edae7bc16b3e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove duplicate subdirs target that slipped inSean Harmer2017-05-121-2/+1
| | | | | Change-Id: Ia2c5a7ae98d5a3cbf7c0981caeccaa4245a57707 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* QNode: setParent create creation change only when neededPaul Lemire2017-05-103-2/+68
| | | | | | | | | | | | | | | | Two cases need to be handled by setParent: 1) Parent already has a backend node and receives a new child -> in which case we need to send the creation event to the backend 2) Parent was created in the frontend, but has no backend (delayed notification sending because a ctor can't call a virtual) -> in that case, when adding a child and setting its parent we shouldn't be sending the creation change. We rather let that be handled when the creation change for the parent is requested Change-Id: I434c7d4e6af785c0314ac6538dc689992d90ed0c Task-number: QTBUG-60612 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.9' into 5.9.0" into ↵Jani Heikkinen2017-05-095-8/+17
|\ | | | | | | refs/staging/5.9.0
| * Merge remote-tracking branch 'origin/5.9' into 5.9.0Oswald Buddenhagen2017-05-085-8/+17
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/render/geometry/buffer.cpp Change-Id: If4d28a1e4c95cbd8e81b1751eed3214952516d8c
| | * Fix Buffer uploadingPaul Lemire2017-05-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to load buffer data when creating it. This led to cases where we would not take into account immediately buffer updates after creation. This would then results in artifacts that would pop up on screen as actual buffer data and count would be different Change-Id: I5a2fad4fb5d7c1e1542cd0bf87ded16a111bc613 Task-number: QTBUG-60429 Reviewed-by: Oleg Evseev <ev.mipt@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Revert to using new window for each testSean Harmer2017-05-074-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the underlying problem from QTBUG-58107 in the macOS QPA is fixed we can go back to using a fresh window for each test function. Task-number: QTBUG-58107 Change-Id: If77fa7dbcb5b8b1a7e096e262832297ce871313d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Scene2D cleanup - register pick events when scene is initializedAntti Määttä2017-05-093-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current model where mouseGrab is connected to picker signal doesn't work. The pressed event is not sent to scene2d item, because it is already lost when scene2d gets the grabMouse message where it registers to the picker events. This breaks the mouse event sequence (press-move-release) for the quick item. Instead hook to setScene of the node to message scene2d when the scene gets initialized and always register to the picker events. Task-number: QTBUG-58876 Change-Id: Ic9ca4b0899a030336ef20ff2cffbe10b567c36f5 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* | | Add autotests for new animation classesAntti Määttä2017-05-0915-2/+1418
| | | | | | | | | | | | | | | Change-Id: Id657443693009455c9307b51e862d43f41255f1d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Scene2D cleanup - remove qml engine and sourceMäättä Antti2017-05-092-57/+6
|/ / | | | | | | | | | | | | | | | | | | Remove QQmlEngine constructor and source property. Update unit tests and manual tests accordingly. Task-number: QTBUG-58876 Change-Id: Ide06bb1381f48efa5378f9a008476734a33089c1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* | Scene2D: put picking coordinates back in window coordinatesKevin Ottens2017-05-051-8/+8
| | | | | | | | | | | | | | | | | | We get the picking coordinates in model local tex coords which have a different convention than the mouse events in window coordinates. So flip them vertically to pass them in the right convention. Change-Id: I558cc62c7c820677407730eead8011193a4b967c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge 5.9 into 5.9.0Oswald Buddenhagen2017-05-041-0/+6
|\| | | | | | | Change-Id: I02adbc5294f9d5879cb05e75eccad74196ea2a7c
| * Renderer: fix OnDemand renderingPaul Lemire2017-04-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: this is a risky change For some reason the renderer assumed that a RenderQueue would never have a size of 0. This prevented the renderer from calling proceedToNextFrame() on the vsync advance service as it somehow felt that it was a case of rendering with a RenderQueue not yet ready. In the case of OnDemand rendering it is perfectly valid to have a RenderQueue of 0 (nothing has changed that requires rendering) but we still need to call proceedToNextFrame() otherwise syncChanges() is never called and we end up never updating the aspects ever again. The renderer was updated to 1) check if a RenderQueue is complete 2) check if the RenderQueue is empty. (a RenderQueue can be complete but empty (OnDemand case)) 3) Proceed to next frame if RenderQueue is complete or RenderQueue is empty. Change-Id: I27ae778831c9b136db1e1a69892f6fde291fd965 Task-number: QTBUG-59696 Task-number: QTBUG-54900 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Update manual tests for changes in APIMike Krus2017-05-034-6/+6
|/ | | | | Change-Id: Ia9b5ccf8faed1c22c4fe4054c04a149ff12c6675 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add unit tests for FrameGraphVisitorPaul Lemire2017-04-273-1/+189
| | | | | Change-Id: I1ef3c275649fe874d2dc4c6caf81082729aca360 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Send move events when hover is enabledMike Krus2017-04-251-0/+3
| | | | | | Change-Id: I3bea4f27361dd4f51f8547c6d9d45c964f4fb5d3 Task-number: QTBUG-58607 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Remove last bits of qsortcriterionPaul Lemire2017-04-251-138/+0
| | | | | | | | | QSortCriterion was replaced with QSortPolicy, somehow some files were still around. Change-Id: Ic41fe557eb77c0b8d9d701a875598a7850a92b62 Task-number: QTBUG-55952 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Try to investigate why tst_GraphicsHelperGL3_3::blitFramebuffer() failsv5.9.0-beta3Giuseppe D'Angelo2017-04-181-2/+2
| | | | | | Change-Id: Ide10e84479bdcfea71c29cd46b8a29199574d856 Task-number: QTBUG-59828 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* tst_GraphicsHelperGL3_2::blitFramebuffer(): check how many samples are supportedGiuseppe D'Angelo2017-04-182-3/+6
| | | | | | | | | Apply the same fix as tst_GraphicsHelperGL3_3. Unblacklist the test, since it now passes. Change-Id: I72bde506c3c6c802ed30acf40e10013f01e69de3 Task-number: QTBUG-59921 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* tst_GraphicsHelperGL3_3: remove blacklist of blitFramebufferGiuseppe D'Angelo2017-04-181-2/+0
| | | | | | | | Got fixed in the meanwhile. Change-Id: I3efccd988b39b77bebab628bbf637b302a247cef Task-number: QTBUG-59828 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* tst_GraphicsHelperGL3_3::blitFramebuffer(): check how many samples are supportedGiuseppe D'Angelo2017-04-181-1/+6
| | | | | | | | | | | | | | We can't just generate a multisampled 2D texture with 4 samples per texel; we need to check the implementation-defined maximum amount of samples. Lacking glGetInternalformat*, query GL_MAX_SAMPLES. Since OpenGL does not mandate a minimum, getting 0 is actually allowed; glTexImage2DMultisample however does not accept 0 as number of samples, hence skip the test in that case. Change-Id: Id1b0c9705aed0665093aae44983eac8b656b676f Task-number: QTBUG-59828 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix rendercapture-cpp example crash when using continuous captureMäättä Antti2017-04-181-3/+5
| | | | | | | | | | Disallow multiple simultanious captures. Task-number: QTBUG-59456 Change-Id: Ice7cb854a9a7090664ff5a24f332cb28eba6359e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Juan José Casafranca Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* QRenderCapture: add saveImage() to replace saveToFile()Andy Maloney2017-04-122-2/+2
| | | | | | | | | QRenderCapture::saveToFile() does not return success/failure. Returning this properly means we don't have to verify success somehow. So add a new method called saveImage() to return the information, and deprecate saveToFile(). Change-Id: I7cf6639d90baa8bce8b90ee795d953a021de7978 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix license headers in manual testsSean Harmer2017-04-126-48/+294
| | | | | Change-Id: I5469f6724ad28d171dd8ee631e89410f78919497 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use using namespace declaration to animation clip unit testSean Harmer2017-04-121-8/+10
| | | | | | | Reduces the noise. Change-Id: Icb7eea31b140c4f5380b99ba67f0b9f5519faab6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Rename AnimationClipLoader to AnimationClipSean Harmer2017-04-126-42/+42
| | | | | | | | It handles both loadign from file and from data constructed using the public API. Change-Id: Ic9e71dc60c36869548323312f7129df6c9edd763 Reviewed-by: Mike Krus <mike.krus@kdab.com>