summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * | Render: Use SIMD Vectors and Matrices in the backendPaul Lemire2018-02-0222-401/+515
| | | | | | | | | | | | | | | Change-Id: I19b3b2f8fcb06eb2bc600ebe370465dd15a8eabc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Keep rendering in sync with aspect jobs by adding barriersSvenn-Arne Dragly2018-02-028-70/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure that jobs that depend on a specific state of the renderer (such as context being initialized) never run before this is the case. This reduces the number of possible race conditions and checks we need to do to ensure the jobs and the renderer are in the correct state. This way we no longer swap buffers when nothing has been rendered, which in turn makes sure that we only draw one frame when the render policy is OnDemand and there are no changes. This change also adds a number of assertions on pointers to resources to make it easier to detect missing job dependencies. Finally, this change overhauls the job dependencies in Renderer and RenderViewBuilder. Task-number: QTBUG-66024 Change-Id: I3e4e9dd0dd53b5c88f5c1b17d68df42f28eae794 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Handle primitive restart in buffer visitorLaszlo Agocs2018-02-151-5/+16
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-66407 Change-Id: Ic79851e94fcadee8f707cb2682938692db094aa7 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge remote-tracking branch 'origin/5.10.1' into 5.11Liang Qi2018-02-144-54/+102
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp src/render/backend/renderer_p.h tests/auto/render/renderer/tst_renderer.cpp Done-with: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Change-Id: I2ca9bac4777e51434579edf86030414734f533ac
| * | | Ensure node creation changes are sent before using in list propertiesSean Harmer2018-02-081-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> (cherry picked from commit 8fa23602cff47de6d19d05a8428a8e753bf73d61) Reviewed-by: Antti Määttä <antti.maatta@qt.io>
| * | Fix OnDemand render policySvenn-Arne Dragly2018-02-013-54/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OnDemand render policy has no effect because the ShadersDirty and ComputeDirty flags are always set. This commit resets ShadersDirty so that ShaderGathererJob is only run when needed. It also introduces the TechniquesDirty flag so we know when to run FilterCompatibleTechniqueJob and makes sure the job is only run if the context has been initialized and the renderer is running. Task-number: QTBUG-65965 Change-Id: Icbcc03ed2dc6b14c6580cc794267b5a88e5f4ca2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Add support for layers to control ray castingMike Krus2018-02-053-8/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RayCaster and ScreenRayCaster can have a number of layers which are used to control how entities with the matching layers are handled for ray casting. Similar rules apply as for LayerFilter in the frame graph. Change-Id: I9f666563a686ac99d7f178da33a539ba9edef51b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Unit test for ray casting jobMike Krus2018-02-015-0/+382
| | | | | | | | | | | | | | | Change-Id: I3b183bfe0231409facce40a7dacc3b923d65b73f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Unit tests for QRayCaster and backend nodeMike Krus2018-02-015-0/+311
| | | | | | | | | | | | | | | | | | Change-Id: Ic3b9676497086b228e467bae3eebeef5c5beb8ce Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Manual unit test for ray castingMike Krus2018-02-0112-1/+637
| | | | | | | | | | | | | | | | | | Change-Id: Icdd27b5ef6b50512e4af40d68d1ba7525f56b991 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Introduce QScreenRayCasterMike Krus2018-02-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split common functionality into abstract base class. Both frontend classes use the same backend implementation. Split common pick functionality for the object picking and ray casting jobs into abstract base class. Change-Id: Ieb8bdcf65d81db12234841d72c6cb0160e145bf6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Ray casting jobMike Krus2018-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Does the intersection calculations and sends hits back to frontend object. The entity pointer is updated in the front end before emitting the signal. This is done using private friend method to avoid detaching the hit object and causing a copy. Change-Id: If2fa0573f8f7120f2dcbb433c46efe1859f0eb5f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge branch '5.10' into devSean Harmer2018-01-268-6/+1018
|\| | | | | | | | | | | Change-Id: I4728b29c349a16867951a781c9417054c798e04a
| * | Unit tests for Matrix4x4Paul Lemire2018-01-265-1/+975
| | | | | | | | | | | | | | | Change-Id: I1b269bd33dd033d628d5bdb3fb014fec86277859 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | SceneLoader: fix broken scene tree unloadingPaul Lemire2018-01-231-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To unload the scene, we need to process the empty path in the backend to reset the status and send a change to the frontend QSceneLoader that will take care of deleting the previously created scene tree. With the introduction of remote urls support, the case of the empty path was not properly handled. It would end up being recognized as a remote path, a download request would be made. Eventually it would silently fail. A warning was added when a download request fails. Change-Id: I60222453ccde63d69f6a107d33d7c842313d98ed Reviewed-by: Sean Harmer <sean.harmer@kdab.com>