summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Animations: handle colors as vec3 or vec4Paul Lemire2020-03-191-8/+82
| | | | | Change-Id: If450816fadce4adad4881938ecaea9c4000afe16 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Destroy FBOs when RenderTarget node is destroyedPaul Lemire2020-02-171-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>
* 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: Paul Lemire <paul.lemire@kdab.com>
* Fix picking with primitive restartMike Krus2019-12-131-6/+20
| | | | | | | Task-number: QTBUG-71919 Change-Id: If7923fab6c43f5d7139d1bbdceb73c17bf489099 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 69789d0184ffa54c1760ad5204bb4539c9399753)
* Add a property map job in animation aspectJuan Jose Casafranca2019-09-238-89/+547
| | | | | | | | | | | | | | | | | ClipAnimator is always dirty because at each frame the normalizedTime is changed. This has a big performance penalisation as we are launching job which updates the property map at each frame. This patch adds a new dirty flag which is use to decide if the animator need to update the mapping of the fcurve to actual node properties. Using that flag, a new UpdatePropertyMapJob is launched for dirty clipAnimators. Some scenes boost from 30fps to 60fps (vsync) during animation. Change-Id: Ic8a8db01535c55995bc569ea5a69660a40014401 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Matrix_SSE/Matrix_AVX2: fix mapVectorPaul Lemire2019-08-202-0/+98
| | | | | | Change-Id: I4584d2c879a72eccbaf273d0e84b3b6f6bb55295 Task-number: QTBUG-77675 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderStates: fix override of nested RenderStatesPaul Lemire2019-07-181-4/+4
| | | | | | | | | | | | | | When merging states, make sure we don't add several states of the same types with possibly different values. We should only add states with type we don't already have. Since the FG traversal is done from leaf to root, we know that the states we already contain should override any state that may have been specified higher up in the FG branch. Change-Id: I9bd1eadd37e8addf740a4b85b2318f9be269fedb Task-number: QTBUG-76766 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRay3D: normalize the direction vector internallyPaul Lemire2019-07-151-18/+18
| | | | | | | | | It can be created with a non normalized dir vector but we should always perform the computations with a normalized dir vector for correct results. Change-Id: Ie9108de7ed2092f6b979a70ad9391267fe6c4696 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix removal of components when they are destroyedMike Krus2019-05-281-1/+10
| | | | | | | | | | | | | | | | | | | Automatic removal of components when they are destroyed is based on connecting to the destroyed() signal. This however means that by the time removeComponent() is called, the pointer is no longer a valid QComponent (just a QNode). While accessing member data of derived classes such as nodeId is fine, emitting signals from derived class does nothing, and in some cases asserts. Fix this by: - doing the QComponent clean up from it's destructor - implementing a separate method on QEntity to simply clear the now partly invalid pointer from the list. Change-Id: Id7632ee2ceaff6548c44c7a43ae40a0372febde9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix Parameter priority sortingPaul Lemire2019-05-241-0/+321
| | | | | | | Parameters defined on an effect have priority over those defined in a Technique. Change-Id: I49558a065b613d7ea9d1cbf0a64f6d5aad941cd3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Clean up warningsMike Krus2019-05-282-3/+4
| | | | | Change-Id: I1ddad305359586481021e85f6e4a470d3a6521b0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QChannelMapping: only send const char *propertyName to backendPaul Lemire2019-05-104-50/+6
| | | | | | | | | | It was otherwise sending a QString property as well as the const char *propertyName. Given only propertyName is actually used, remove QString property from the backend to avoid useless confusion and stop sending the notification change. Change-Id: Ie26771e320e26d44d7fce3e0a864bad1d4df558f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Restore ShaderBuilder unit testsPaul Lemire2019-05-101-1/+0
| | | | | Change-Id: I2a3a013078a71610cd5c61cf988f6bfa8d6159ac Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update ShaderBuilder tests following changes in QShaderGeneratorPaul Lemire2019-05-093-19/+3
| | | | | Change-Id: Ia047e79bcb2ecb7da3438c4cb4980377dc20744e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix FrameGraph node parentingJim Albamont2019-04-161-34/+18
| | | | | | | | | | | Framegraph suffers from the same problem as Entities. When they are created they pass their parent FrameGraph node, and not their parent QNode. When reparenting them we need to make sure the same thing happens otherwise you get backend FrameGraph nodes parented to non-framegraph nodes and they are just dropped from backend. Change-Id: I1b9cab2c9e869c690c4c43208e62a1044b3359a4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Cache light/renderable/computable vectorsJames Turner2019-04-102-22/+97
| | | | | | | | This avoids running these jobs when lights / renderables have not changed in a frame Change-Id: I604180fe3442ab67648c4ba5d9effb8639c68ef7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Disable ShaderBuilder unit testsPaul Lemire2019-04-101-0/+1
| | | | | | | To allow Qt base QShaderGenerator changes to be merged Change-Id: I0036215bc5f841246cc109f21c87a07563ec0f11 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix backend node creation order using an initialization queueJim Albamont2019-04-081-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backend nodes should always be created from the top-most parent down ensuring that every parent is created before its children. The original way of creating backend nodes by calling _q_postConstructorInit in a deferred manner from the QNode constructor breaks this because backend node creation happens in the order that the nodes on the front-end were created. This was often incorrect when reparenting newly created nodes. Fix by creating a queue of nodes needing a _q_postConstructorInit call and only adding nodes to the queue if one of their ancestors is not already in the queue. This ensures that _q_postConstructorInit is only called for the top-most node in any subtree. This behavior exactly matches the creation behavior when building a subtree and reparenting it to a node with a backend. Doing silly things like creating a node with a parent that has a backend then immediately reparenting is now safe. After this patch, it should be safe to assume that backend nodes can always find their backend parent. Adding only the top-most nodes to the queue and processing the entire queue at one time also ensures that all creation events get sent in the same batch. This fixes the problem of having backend nodes referring to other backend nodes that haven't been created yet. Task-number: QTBUG-74106 Task-number: QTBUG-73905 Change-Id: Idcf38d6c3164f6be4394a3b25554547414061059 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix Entity parenting hierarchyJim Albamont2019-04-0410-1/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the initial Entity backend node hierarchy is created it skips over any non-entity nodes to ensure that Entities are only parented to other Entities. Calling QNode::setParent breaks this when reparenting Entities to non-entity nodes. Fix by sending a new "parentEntityUpdated" property update that backend Entity nodes listen for. They keep the id of their new parent and flag the need to rebuild the entity hierarchy. This triggers a new job to clear the children and parents of every backend Entity, then rebuilds the hierarchy using the stored parent ID in each Entity. This is much more forgiving of creation/parenting ordering issues and shouldn't be less performant because any Entity reparent was previously marking everything dirty anyway. Add a new test from QTBUG-73905 that creates 4 cylinders and manipulates the parents in different ways. Add a new test to tst_nodes to reparent a QEntity to a QNode and ensure the entity finds it's correct QEntity parent. Add a new test to tst_entity to ensure backend nodes correctly handle the new parenting events. Task-number: QTBUG-73905 Change-Id: Iab0203947d89bbed2868b3629fbde879675fe568 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Animations: handle variable length propertiesPaul Lemire2019-04-035-102/+499
| | | | | | | | | For that we know determine the expected number of channel components for a given property in the frontend where we have access to both the type and the value rather than in the backend using the type only. Change-Id: I75aca20d43dd1b3db316c303af041acd557c07e4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update the backend's buffer data when updating part of QBufferGiulio Camuffo2019-04-021-1/+1
| | | | | | | Cherry-picked from da7e453d001715f9b0fc9eaf29dd245058e23dab Change-Id: I9cf18df56d501c7ea49727bc2d1da20371308d4a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unify shader include handlingMichael Brasser2019-04-016-0/+31
| | | | | | | | Share the code for this between QShaderBuilder and QShaderProgram. As a side effect QShaderProgram gains support for absolute paths. Change-Id: I71dbe0bff702806f0655992008c54bbaa9c4f2c9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Dont play animations that are disabledJuan Jose Casafranca2019-03-281-9/+47
| | | | | | Change-Id: I5293ff8d16c511de79c4583783b238154af32f61 Task-number: QTBUG-69373 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.12.2' into 5.12Qt Forward Merge Bot2019-03-151-2/+216
|\ | | | | | | Change-Id: Idc824e1b8191e5fa624966e619075b1ec8c850c6
| * Make sure backend node is created when component is added to Entityv5.12.2Svenn-Arne Dragly2019-02-221-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | In addition, the parent of the component and all further ancestors need to be registered on the backend. We do this by calling QNodePrivate::_q_postConstructorInit on all these nodes. Also add autotest that triggers the case referenced in QTBUG-72236 to avoid regressions. Change-Id: Ibf8f43654d145ea8b8082b2f30123ea65e42ff55 Fixes: QTBUG-72236 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: James Turner <james.turner@kdab.com>
| * Add test for component added to parent with pending backend creationSvenn-Arne Dragly2019-02-221-2/+76
| | | | | | | | | | | | | | | | | | | | This test makes sure that the order of events is correct when a parentless component is added to an entity that does not yet have a backend node because it was created with a parent and thus has not yet called _q_postConstructorInit. Change-Id: I6d15003549cc9d327c5c2de84723e5f8897e4dcf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Fix broken creation order for nodes used as propertiesSvenn-Arne Dragly2019-02-221-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, child nodes may be constructed before their parents and their node creation changes will arrive at the backend out-of-order. This could result in a child node referencing a parent that we have not yet received a creation change for. Also add a unit test to take this case into account. Change-Id: I26b29e63863d1686e7b9239c63297c7e6c341f4e Task-number: QTBUG-73986 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | tests/auto/render/render.pro: Remove duplicate entry "scene2d"Friedemann Kleint2019-03-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The entry is added unconditionally and in a scope qtConfig(qt3d-input). Remove the first entry, fixing: Makefile:3343: warning: overriding recipe for target 'sub-scene2d-qmake_all' Makefile:2918: warning: ignoring old recipe for target 'sub-scene2d-qmake_all' Makefile:3347: warning: overriding recipe for target 'sub-scene2d' Makefile:2922: warning: ignoring old recipe for target 'sub-scene2d' Makefile:3350: warning: overriding recipe for target 'sub-scene2d-make_first' Change-Id: I6e702cdea2e31eb0de64c7efb7d39b56265fa6ef Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Use slerp for animating rotation channelsJuan Jose Casafranca2019-02-224-2/+96
|/ | | | | Change-Id: Ic6aa6fd1c1a1e7757dba9466b59d20834b56e246 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix: rebuild material and layer caches when FrameGraph tree is dirtyPaul Lemire2019-02-192-33/+84
| | | | | | | | | | This could otherwise result in black screens when the FrameGraph tree is updated and no other change is sent. Screen would remain black until some other element with dirty changes triggers a cache rebuild. Change-Id: Iac43965f06d1d644de14e6a6c8768e035bed69a6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Recompute bounding volumes when buffer changesPaul Lemire2019-01-071-0/+2
| | | | | | | | | | Right now the bounding volumes would be computed only when a geometry is marked dirty, which essentially means only when the geometry is first loaded. However, if a geometry buffer were to change, we need to recompute the bounding volume. Change-Id: Ie3fb83d1cc11a3bbfbe2b9828e9f8d7c302d175b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QRenderCapture: Prevent crash on shutdown when replies are pendingChristian Andersen2019-01-061-0/+19
| | | | | | | | | | | | | When a QRenderCapture is deleted its destructor runs, then the QFrameGraphNode destructor, then the QNode destructor and finally the QObject destructor. The QObject destructor deletes its QObjectPrivate member, which destructs QRenderCapturePrivate. At that point the QRenderCapturePrivate tries to disconnect on an invalid pointer to the QRenderCapture (which was already deleted). Change-Id: Ib5835e3f86a282b963220b0dab656258111a61ab Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QEnvironmentLight: add uniforms for envmaps sizePaul Lemire2018-12-201-0/+98
| | | | | | | | | This makes future ES2 PBR implementation possible as textureSize() is not available on ES2 Change-Id: Ibf2b36240778a3f30f4316a67819f9052e46bdf1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Texture: initialize internal format to NoFormatPaul Lemire2018-12-192-1/+24
| | | | | | | | | | | | | | | | | | | Format was initialized to RGBA8_UNorm on TextureProperties. This had the side effect that if you created a TextureLoader entry with no source yet set, the backend would try to load and return early since no texture data had yet been generated. Yet it would still send a notification change with the format (which was RGBA8_UNorm instead of NoFormat) back to the frontend QTextureLoader. This would prevent the QTextureLoader from later being loaded correctly with the format actually read from the image file. Also updated QTextureData/QTextureImageData/QTextureFromSourceLoader for consistency. Change-Id: I23e2287fac297b9b8901476715b1bc1e78c6342b Task-number: QTBUG-72651 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-12-041-0/+88
|\ | | | | | | Change-Id: I9f4dd807f0179d7bd95a5263e57c37198e7432f4
| * Reset last selected picker when releasing out of viewportPaul Lemire2018-11-301-0/+88
| | | | | | | | | | | | Change-Id: Iec70e84024caf879358183fee34638def5038aef Task-number: QTBUG-72160 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-221-1/+20
|\| | | | | | | Change-Id: I1a1c178055502b1cd37ad1be30dcb2f5409ed7a8
| * Complete ES 3.1 and 3.2 helpersPaul Lemire2018-09-211-1/+20
| | | | | | | | | | | | | | | | | | | | | | Which didn't handle indirect drawing, compute and tessellation Since ES 3.1/3.2 don't provide API for glShaderStorageBlockBinding, code was adjusted to use the default binding points and not require that API. Change-Id: Ie4dcd05f0a1d72e4a25f49b5fae138dc605ba5e3 Task-number: QTBUG-70660 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add private API to access child nodes of QEntity and QFrameGraphNodeSvenn-Arne Dragly2018-09-032-16/+77
| | | | | | | | | | | | | | | | | | | | | | | | This opens up for reduced bookeeping on the backend, and is used by the experimental Dragon render aspect, which is currently being implemented in qt3d-runtime. Change-Id: I4cc2e98e4e0e7e8d456ed11c4fbc48db5c93f2a2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 77e418fde850c86e39d9dd8528876599fbe9dc34) Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Renderer: remove code shutting down thread in renderer dtorPaul Lemire2018-08-207-1/+246
|/ | | | | | | | This should have already been performed by Renderer::shutdown(). Doing it again in the dtor only hides potential issues. Change-Id: I33b02df42d1667ea4cbc02cb6f4cb8fabcf70996 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Improve backend texture unit testsPaul Lemire2018-08-131-0/+186
| | | | | Change-Id: Ie7baba99e03defcd3d8194fd11838a86d1680060 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Enable ConstantInterpolation for fcurvesJuan Jose Casafranca2018-07-311-0/+22
| | | | | Change-Id: If51c8377f5b29433feaa520a7586f0608b7510f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix: Do not enforce TextureImage to be parented only by TexturePaul Lemire2018-07-182-19/+211
| | | | | | | | | | | | | | | | | | | | This behavior prevented using TextureImage not directly parented by the Texture that uses them (assert would be triggered). In turn, this also prevents sharing a TextureImage among several Texture instances which is counter productive since this is where the data is actually stored. This patch fixes this issue. It removes all direct coupling between Texture and TextureImages. Now Texture only contains the list of TextureImage ids it references. This allows to not make look-ups into the TextureImageManager to retrieve handles, which could be an issue if TextureImages have not yet had their backend created. TextureImage doesn't keep track of the referencing texture that uses it anymore. Instead, we let the renderer do the job of checking if any of the TextureImage referenced by a Texture has changed to trigger actual Texture update. Change-Id: I3c63379d0f4b314e9b53f225870eeaded0bb4aec Task-number: QTBUG-69407 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QNode: _q_postConstructorInit set scene on whole subtreePaul Lemire2018-07-181-0/+49
| | | | | | | | | | | | | | | _q_postConstrutorInit is called in a deferred invocation when constructing a Node with a parent. If several nodes are created that way, the _q_postConstructorInit call from the node which parents the other will actually build the node creation changes for the whole subtree and incidently prevent the _q_postConstructorInit invocation for the children to do anything (including setting the scene). Therefore _q_postConstructorInit should set the scene on all the Node it will be creating creation changes for. Change-Id: I07d4e80675758b9701cc941881f1faaa1c89af4b Task-number: QTBUG-69352 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Check animator can be played in frontend and backendJuan Jose Casafranca2018-07-111-0/+27
| | | | | | | | | | | We check that the animator can be played in the frontend. Each animator subclass must implement their own canPlay method. In the backend we correctly check the clipAnimator can be played Task-number: QTBUG-69369 Change-Id: If8bca9b73321e2bfdb4d68ddc286df0109ee91f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Do not delay cleanup of backend Texture instancesPaul Lemire2018-07-113-0/+76
| | | | | | | | | | | | | | | | | | | If we delay the cleanup of backend Texture instances, in the case of a texture being reparented from an existing node with backend to a node with no backend, the resulting node destroyed, node created changes delivered in the same loop would result in the Texture still being marked for destruction and eventually being destroyed even though it was recreated. This patch now still marks textures that were destroyed (by storing their ids), so that the GL Texture managers can update the resources accordingly. However, we now cleanup Textures immediately. We also remove textures ids marked for destruction in the GL texture managers if we detect a Texture with the same id is readded. Change-Id: I29092d7dff9f70bb9fb4b15f4e9419ee1791b6e2 Task-number: QTBUG-69379 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* More fuzzy evaluation when calculating rootsChristian Strømme2018-07-101-0/+13
| | | | | | | | If the discriminant is close to zero, evaluate it as being zero. Change-Id: Ief2624dd512d703e44d8a0c63431baef3cee7c45 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Handle reparenting to nodes which have no backendPaul Lemire2018-07-041-0/+158
| | | | | | | Change-Id: Ibbaae84a616afbe8be35904e9185be668e32f1c7 Task-number: QTBUG-69284 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QGraphicsApiFilter: fix Vulkan enum value aliasingPaul Lemire2018-06-251-0/+9
| | | | | | Change-Id: I8c8583e318aef59c4fc280bc85ea6171538f53f3 Task-number: QTBUG-69028 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix race condition when executing multiple filterlayerjobs at oncePaul Lemire2018-06-253-3/+10
| | | | | | | | | | The updating of referenced layer ids for each Entity should only be performed once and not by multiple jobs. Therefore, this update was moved into a dedicated job which is now a dependency of the filterentityjob instances. Change-Id: Ie8ecc49a7c6c7d41a1f1f0d18619b5e142b68204 Task-number: QTBUG-68942 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>