summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Improve backend texture unit testsPaul Lemire2018-08-131-0/+186
| | | | | Change-Id: Ie7baba99e03defcd3d8194fd11838a86d1680060 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Properly update properties from Backend to Frontend texturesPaul Lemire2018-08-087-1/+308
| | | | | | | | | | | | | | | | | | | Taking into account we have texture sharing in the backend, we can only update frontend texture properties once we have created the shared backend texture. Code was adjusted to retrieve these properties when creating the GLTexture. Such changes are stored and sent on the next run loop from a job where they are distributed to all referenced frontend Texture. The status property handling has also been updated to send status changes to all shared textures instead of just the texture whose data generator is used to gather the data. A manual test checking texture property updates, sharing and remote url sharing has also been added. Change-Id: I8ed2449fe57c9d7337580b0f7561f974cbd5006d Task-number: QTBUG-65775 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add support for loading specific animations from glTF 2 filesSean Harmer2018-08-029-0/+586
| | | | | | | | | | | | | | Can now specify source urls to QAnimationClipLoader with query parameters for animationIndex or animationName. Add a new manual test to demonstrate/test this by loading the 2nd animation from the Rigged-Simple.gltf file. Will followup with the same support for Qt 3D native json animation files. Change-Id: Icb66073f29b8471fe06e2e2e9c43720567dc9ee5 Reviewed-by: Paul Lemire <paul.lemire@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-188-20/+435
| | | | | | | | | | | | | | | | | | | | 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>
* Fix compile warningsPaul Lemire2018-06-202-3/+3
| | | | | Change-Id: I71f1352de28383d5105c7ff887191265b509d191 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix UniformValue data size for texturesLaszlo Agocs2018-06-121-0/+9
| | | | | | Task-number: QTBUG-68759 Change-Id: I26d4db00bf58ce6061a797e415371abaee1b1202 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid locking up on Radeonv5.11.0-rc1Laszlo Agocs2018-05-041-1/+1
| | | | | | | | | Could not find a decent way to do a renderer/vendor string query due to the convoluted internals so just used a define for now. Task-number: QTBUG-67937 Change-Id: I0dcfa41377a5e430d3f7973c5aaa01535100c53c Reviewed-by: Liang Qi <liang.qi@qt.io>
* Animation: Make a fuzzy comparison when verifying cubic rootsSvenn-Arne Dragly2018-04-241-35/+53
| | | | | | | | | | Accept cubic roots that are close enough to 0 or 1 that the difference is likely a numerical error. Also add a regression test to catch one of these corner cases. Task-number: QTBUG-67886 Change-Id: Ia05650699638e4bb7d13fa18b31d71071909bd51 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add replacement materials examplev5.11.0-beta3Sean Harmer2018-04-042-2/+2
| | | | | | | | | | | | | | All texture assets were made by KDAB under the CLA. The material "sphere" mesh is from Allegorithmic and published under the Creative Commons 4 license. See paragraph 1.2 of https://www.allegorithmic.com/legal/substance-share Task-number: QTBUG-61415 Change-Id: I23d61723bbac561e22e11fa57105b29148c01699 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 74c06c02f896c6aba408cfd0857d317378572736)
* Fix findCubicRoots for cases where coefficients are close to zeroSvenn-Arne Dragly2018-03-251-0/+90
| | | | | | | | | | | | | | | The equation is a*x^3 + b*x^2 + c*x + d = 0. Previously, we would divide by zero if a = ~0. This change also makes sure that we return zero no roots in the case where a = ~0 and c*c - 4*b*d < 0, and the case where a = b = c = ~0. Finally, we return 0 or 1 if we're close enough to assume that it could be a numerical error. This change also adds tests for the above cases. Change-Id: I426d2fc6175b3aff6fe099845bf63d433c158536 Co-authored-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* MaterialParameterGathererJob: remove unneeded renderer memberPaul Lemire2018-03-193-3/+0
| | | | | Change-Id: I05bef741048fbb29fab261b48f48a20d1d131bcc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* tst_loadscenejob: remove warningsPaul Lemire2018-03-191-2/+2
| | | | | Change-Id: I2db7a8dccac5d6ec808734786c8f8349f84dcfe4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* AbstractRenderer: add setOpenGLContext methodPaul Lemire2018-03-191-0/+1
| | | | | | | | | | This will allow to only deal with the AbstractRenderer class interface in the QRenderAspect. Then in practice, the setOpenGLContext function may just be ignored by renderers which don't care about OpenGL Change-Id: I1adc9c203e78a31ef1054a3be36e703b4e1a6f3e Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* SendRenderCaptureJob: remove hard dependency to RendererPaul Lemire2018-03-192-8/+16
| | | | | | | | This will allow it to be reused by the various renderers Change-Id: I5707496a40b91077a363734cc72af820ec5ca8c4 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Move Renderer specific classes into new folderPaul Lemire2018-03-193-12/+25
| | | | | | | | This is another step toward isolating the renderer from the render aspect Change-Id: I4031675b961d6645b65bbe05cf62d150993038b0 Task-number: QTBUG-61151 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Perform Shader loading within framePaul Lemire2018-03-161-3/+4
| | | | | | | | | | | | | | | - CommandThread has been improved to not use an exec loop and properly instantiate its own GL context + GraphicsContext that is bound to an offscreen surface - The dirtyShaderGathering job has been renamed and now performs the loading of shaders and their introspection. It is also run before the materiaparameter gathering, so that these jobs and the following can assume a shader is ready Change-Id: I6d99b3a104bd96530dc45f4b05d3aaac09d2d077 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Split GraphicsContext in twoPaul Lemire2018-03-162-4/+11
| | | | | | | | | - GraphicsContext is now a stateless wrapper around GL calls - SubmissionContext is a GraphicsContext + caches and states used to render a frame Change-Id: I147b56dfd4c403911faadc0e9821fff9a892f71c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Renderer: instantiate, initialize and shutdown CommandThreadPaul Lemire2018-03-161-0/+3
| | | | | | | Change-Id: I89a3ee4b6d72565c1be91244c1bde39f1dd7101b Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Notify texture status changedMike Krus2018-03-161-2/+5
| | | | | Change-Id: Id8ef731d5f80648c19221c1d1b334bd8367188c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add more job tests for raycastingMike Krus2018-03-075-8/+490
| | | | | | | | | | - test screen space ray casting - fixed handling of filters - fixed handling of ray length - few tests for filter handling Change-Id: Ifc24d8f9e73556669338b3936a41dfa2c674e306 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add unit test to check memory alignmentPaul Lemire2018-03-015-0/+267
| | | | | Change-Id: I59b817f9972d0a6866f7cc57a4bcd6fe2cd097c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add test to check if readding shader removes dna from m_pendingRemovalAnders Hafreager2018-02-281-0/+27
| | | | | | | Task-number: QTBUG-66498 Change-Id: Icb18a996c9384b3e41f296694d91b13677f054c4 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RenderThread: fix races with texture and bufferPaul Lemire2018-02-281-2/+7
| | | | | | | | Add dependencies to ensure we won't allow the RenderThread to proceed if we haven't completed the execution of the texture and buffer gatherer jobs. Change-Id: Iaad67be893738b948bf26ca903f3bff7f16a1b88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix race between RenderThread and ShaderGathererJobPaul Lemire2018-02-281-2/+4
| | | | | | | | | | By setting the proper dependency which ensures we are done looking for dirtyShaders by the time updateGLResources in the RenderThread is executed. Patch provided by svenn-arne.dragly@qt.io Change-Id: I4515cbfc3a391f887a42178220e6f0814a707745 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix RenderView uniform minificationPaul Lemire2018-02-281-5/+86
| | | | | | | | | In the case where we had two or more groups of RenderCommands where each group shares a common shader, uniform minification wouldn't be applied to the second command of each groups after the first one. Change-Id: Ie73f559e3f44f0f22ddd79017fd413262cae6ab4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Load textures in a single framePaul Lemire2018-02-283-8/+284
| | | | | | | | | | | | | | | | | Because of texture sharing, Qt3D compares functor before executing them. Instead of blindly loading a TextureImage functor which could turn out to not be used, Qt3D required 2 frames to fully update a texture. This behavior has been removed, now when a texture image functor is updated, it updates the texture in one frame. It is assumed that the user is responsible for declaring only TextureImage that he is actually going to use. Any scene that uses OnDemand rendering and frequently changes a texture image functor can be used to test this. (ex-painted-cube is a good example for KDAB) or paintedtexture-cpp in manual tests Change-Id: I8c2f13876244a862633e10e472e2b49cbd6e126b Task-number: QTBUG-63561 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Revert "Keep rendering in sync with aspect jobs by adding barriers"Paul Lemire2018-02-288-255/+71
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 46319648436814afb5a77755dde6681e304befaf. We want to be able to render one set of RenderViews for frame n while concurrently building RenderViews for frame n + 1. The reverted commit removed that behavior which reduced the CPU time available to prepare a frame. This would cause on some scenes a failure to meet the ~10ms budget we have to prepare a frame. This is therefore a regression. The root cause behind this regression is that a job cannot be executed until all the jobs which have been previously launched have completed. The proposed solution would be to instead add an OpenGL command thread that can be used to load graphics resources required for the RenderViews directly when required. This would in turn allow to cache RenderViews and keep the concurrent behavior of RenderView submission and creation. With that goal in mind, the following patches will be rebased and updated https://codereview.qt-project.org/#/c/189309/ https://codereview.qt-project.org/#/c/189310/ Change-Id: I4879047c45986a0e615e3aef7b7352f82a04a9da Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add unit test for QScreenRayCasterv5.11.0-beta1Mike Krus2018-02-243-0/+142
| | | | | Change-Id: I76933b23f27bc0fefcbc55342715b2ebd7f7716d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add unit test for layers on raycasterMike Krus2018-02-231-0/+84
| | | | | Change-Id: I5f8401e7a61924fbfe88fddf5b44fd77fa92099d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-216-1/+119
|\ | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp tests/auto/auto.pro Change-Id: Idc5bb088ae7f591809f8795124a3e44410bf4cf9
| * ObjGeometryLoader: Fix out of bound errorPaul Lemire2018-02-086-1/+117
| | | | | | | | | | | | | | Apparently this was a major security issue reported to security.qt-project.org Change-Id: Id52f035134ca6111e24b5820eb1b64b99449e47f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QParameter: add bookkeeping of QNode valuesPaul Lemire2018-02-211-0/+22
| | | | | | | | | | Change-Id: I0a7334907e4b34df6955fb24832958b674d7b62b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.10' into 5.11Sean Harmer2018-02-1535-527/+1400
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/animation/doc/src/qt3danimation-module.qdoc src/render/backend/abstractrenderer_p.h src/render/backend/buffervisitor_p.h src/render/backend/renderer.cpp src/render/backend/renderer_p.h src/render/backend/triangleboundingvolume_p.h src/render/backend/trianglesextractor_p.h src/render/frontend/sphere_p.h src/render/jobs/calcboundingvolumejob.cpp src/render/jobs/job_common_p.h src/render/jobs/pickboundingvolumejob.cpp src/render/jobs/pickboundingvolumejob_p.h src/render/jobs/pickboundingvolumeutils.cpp src/render/jobs/renderviewjobutils_p.h tests/auto/render/boundingsphere/tst_boundingsphere.cpp tests/auto/render/commons/testrenderer.h tests/auto/render/raycasting/tst_raycasting.cpp tests/auto/render/render.pro tests/auto/render/renderer/tst_renderer.cpp Change-Id: I76633bc5a5a065e5f9ea62cc16563377e5c693a3
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Sean Harmer2018-02-058-51/+843
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/render/backend/trianglesvisitor.cpp src/render/backend/uniform.cpp src/render/jobs/calcboundingvolumejob.cpp src/render/jobs/pickboundingvolumejob.cpp src/render/jobs/pickboundingvolumeutils.cpp Change-Id: Ib8305011c51710a3538c0b29f7022388f5244a38
| | * Ensure node creation changes are sent before using in list propertiesSean Harmer2018-02-021-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completes the fix for out of order event delivery related to creation changes. We now ensure that QNodes used as values in singular and list properties are fully constructed on the backend before they are referenced in properties of other nodes. Also added a check to not recurse into sending too many changes when adding a child node. Written with Svenn-Arne Dragly. Task-number: Task-number: QTBUG-65956 Change-Id: I1470e0f685c81d1277ac04ad985ec1b76f1c27c0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Add test for picking object from multiple directionsMike Krus2018-02-023-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | This would have caught the breakage caused by changing how the camera view matrix was computed Change-Id: I521b7e6c700aeaa1c751cdf0aceb8b8ab66a6af9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Compile failing shaders once only and avoid asserting on failureLaszlo Agocs2018-02-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way a material with a broken shader will fail once (and won't be retried unless the shader code gets changed), and the application will continue gracefully, without asserting. Task-number: QTBUG-65936 Change-Id: I7003e8c6f7d9094280d7757c1020b485f93e3b37 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Handle 0 stride vertex dataMike Krus2018-01-292-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All examples, even with packed data, set actual vertex size on the attribute. However, convention is to pass 0 for packed data, in which case GL will compute vertex size based on number of coordinates and component data size. Neither the buffer visitor nor the triangle visitor respected this convention and relied on the real size to be set. Now computing the actual stride if it's passed in as 0. Change-Id: I9a65fd7d8d56f181e31faa93389e3fdd1a973c17 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Revise buffer traversal in bounding volume calculationLaszlo Agocs2018-01-291-1/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Take the index attribute (and buffer) into account, when present. Rely on QGeometryRenderer::vertexCount(), when set. Initially done on dev as: 1d874d33da9174a82fccc266c66a22af006ac8ef Task-number: QTBUG-65590 Change-Id: I98d1865e3581272471d6b93b9633da38dc77163d Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Fix componentAdded/componentRemoved notifications dispatch to componentsMike Krus2018-01-261-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a component is added to an entity, two change notifications were sent but they both were directed to the entity. This makes sure one message is sent to the entity and one to the component, as was intended. Same for remove notifications. Fixed the unit tests which where incorrectly testing for the subject id of the change notification. Change-Id: Ic697c08e92e884abf28e675e4ae2b44a93ca45d5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Handle multiple surfaces properly for pickingMike Krus2018-01-263-43/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues with picking when having multiple viewports and/or multiple windows. Now check that the mouse event actually hits inside the viewport extents. Also track the source of events and check that the surface matches the source of the event. Remaining issue is overlapping viewports within the same window Task-number: QTBUG-59567 Change-Id: I76a4ee2bec7300d893fef6040d89bf81f2109795 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>