summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/renderviewbuilder
Commit message (Collapse)AuthorAgeFilesLines
* Compute renderables/computables/lights once instead of once per RVPaul Lemire2019-10-291-56/+20
| | | | | | | | All RV end up using exactly the same vector before filtering it down on per RV specifics. No point in compute RV times the same thing. Change-Id: Ia674095627771c8e9ada090fa47623cbbbd8a3f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Split RenderCommand generation and uniform updatePaul Lemire2019-10-211-57/+57
| | | | | | | | | | | | | | | | In most cases, we can generate the RenderCommands once and reuse them in subsequent frames only updating the uniforms. We still have to copy the RenderCommands as the renderer renders while we start preparing the next frame. This is still faster than regenerating them entirely. Regenerating the entire commands will happen only when FrameGraph or Scene structure changes. That should rarely be happening on a per frame basis. Next step could be to look at how to only update commands for Entity with Parameters that have changed. Change-Id: I202870850a46fcd3946f81bffddb7027d192f374 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up includesMike Krus2019-10-011-1/+0
| | | | | | | | | Remove include statements for classes that are no longer used. Makes it easier to find remaining use cases that need addressed before complete removal in Qt 6. Change-Id: I60529ba1929ad64b162d3847d5df47cde2a60dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use direct access to remove backend nodesPaul Lemire2019-09-161-1/+6
| | | | | | | | | - Stop using messages - Remove QSceneObserverInterface - Ensure backend node creation/destruction is done at the right time Change-Id: I470825af344ab65bf05e93fc149b61d1b9eefc96 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use sync method when initializing new backend nodesMike Krus2019-08-291-6/+13
| | | | | | | | | | | If the node type supports syncing, use that rather than the creation message. The message is still needed since that is passed to the instantiation functor (none of qt3d's classes appear to use anything but the node id, but can't be sure no other classes do, and can't add other virtual method without breaking BC). Change-Id: Id99f448070b8722a7809b968798772c9eb3c8397 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix some deprecation warningsFriedemann Kleint2019-05-281-6/+12
| | | | | | | | | | | | | jobs/qaspectjobmanager.cpp:90:72: warning: 'T* QWeakPointer<T>::data() const [with T = Qt3DCore::QAspectJob]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] defaults/qtexturematerial.cpp:66:431: warning: 'QVariant qVariantFromValue(const T&) [with T = QGenericMatrix<3, 3, float>]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] ... testpostmanarbiter.cpp:75:51: warning: 'static QVector<T> QVector<T>::fromStdVector(const std::vector<T>&) [with T = QSharedPointer<Qt3DCore::QSceneChange>]' is deprecated: Use QVector<T>(vector.begin(), vector.end()) instead. [-Wdeprecated-declarations] tst_qray3d.cpp:510:100: warning: 'QVariant qVariantFromValue(const T&) [with T = Qt3DRender::RayCasting::QRay3D]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] tst_renderviewbuilder.cpp:331:120: warning: 'T* QWeakPointer<T>::data() const [with T = Qt3DCore::QAspectJob]' is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] ... Change-Id: I446f3ddeb7aa2c5698d2a976fa163b443e01cc0c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch origin/5.13 into devPaul Lemire2019-04-151-24/+12
|\ | | | | | | Change-Id: Ib5c04e9941aeea1a4cd27519b94b9a53e8349ea3
| * Fix: rebuild material and layer caches when FrameGraph tree is dirtyPaul Lemire2019-02-191-25/+14
| | | | | | | | | | | | | | | | | | | | 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>
* | Cache light/renderable/computable vectorsJames Turner2019-02-201-20/+89
|/ | | | | | | | This avoids running these jobs when lights / renderables have not changed in a frame Change-Id: I604180fe3442ab67648c4ba5d9effb8639c68ef7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix race condition when executing multiple filterlayerjobs at oncePaul Lemire2018-06-251-1/+2
| | | | | | | | | | 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>
* MaterialParameterGathererJob: remove unneeded renderer memberPaul Lemire2018-03-191-1/+0
| | | | | Change-Id: I05bef741048fbb29fab261b48f48a20d1d131bcc Reviewed-by: Mike Krus <mike.krus@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>
* 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>
* Revert "Keep rendering in sync with aspect jobs by adding barriers"Paul Lemire2018-02-281-15/+6
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.10' into 5.11Sean Harmer2018-02-151-8/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Render: Use SIMD Vectors and Matrices in the backendPaul Lemire2018-02-021-2/+2
| | | | | | | | | | Change-Id: I19b3b2f8fcb06eb2bc600ebe370465dd15a8eabc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Keep rendering in sync with aspect jobs by adding barriersSvenn-Arne Dragly2018-02-021-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.10' into devLaszlo Agocs2017-12-131-1/+1
|\| | | | | | | Change-Id: Ib51c8311ce78b2fec62dd0c09cb943a85a7d0b2b
| * Improve performance for finding entities in subsetSvenn-Arne Dragly2017-12-041-1/+1
| | | | | | | | | | | | | | | | | | Using set_intersection reduces the time spent in this function by almost 90 %. Change-Id: I993930ad8e017d58352dfe504fa593e11860e6a7 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Cache material parameter gatherer resultsSvenn-Arne Dragly2017-12-061-3/+19
|/ | | | | Change-Id: I0660f876d7d967d552f7982c3e33e7c971c9abb4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix rendering following LayersDirtyPaul Lemire2017-11-161-110/+248
| | | | | | | | | | | | | | | The LayersDirty flag on the renderer was being checked within a running QAspectJob, which resulted in broken rendering (since the flag is cleared before running the jobs). Also in the case of Scene3D we could end up resetting the LayersDirty flag even though we hadn't really rebuilt the caches. Overhaul this part to make it more robust. The render views now always look into the caches and we schedule job to rebuilt the caches instead of doing both at the same time. Updated unit tests accordining and removed the access of the renderer's dirty bits within jobs. Change-Id: Id6b415ba86c91754a960aec3fd88af1ddc21ebe0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into 5.10Svenn-Arne Dragly2017-11-151-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/abstractrenderer_p.h src/render/backend/layer.cpp src/render/backend/layer_p.h src/render/backend/render-backend.pri src/render/backend/renderer_p.h src/render/backend/renderviewbuilder.cpp tests/auto/render/renderer/tst_renderer.cpp tests/auto/render/renderviewbuilder/tst_renderviewbuilder.cpp Change-Id: I5c1b649052992e1b3483d549ddc188c8450e927f
| * Add layer entity filter cachingSvenn-Arne Dragly2017-11-141-0/+4
| | | | | | | | | | | | | | | | Also add all dirty flag enums found in dev. Change-Id: Ib364773002a3170aef66e7b365a0a41d8e60bd92 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Renderer: launch proximity filter jobPaul Lemire2017-08-191-2/+6
| | | | | | | | | | | | | | Also added a manual test example Change-Id: Ib560dcfdd5e0996cb40d892886c94212e3f8e32d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix and improve layer filteringPaul Lemire2017-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now handle the case where multiple LayerFilter nodes are nested within the same FrameGraphBranch. We also have improved the Accept/Discard into Accept Any/All and Discard Any/All which should now handle all filtering cases. We now build a list of layerIds stored into Entity based on the recursive flags on the layers being set. This allows to make layer filtering simpler but the layerIds list building step will need to be improved as a follow up commit Unit tests updated Change-Id: I93451493e41c6c9486defa7e88eaee073a9bc932 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add a job to calculate the skinning matrix palette for a skeletonSean Harmer2017-08-101-1/+1
|/ | | | | Change-Id: Id70f17592935543053137a37b70b6c2f8b7000ed Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Correct filtering of disabled entitiesWieland Hagen2017-01-051-2/+3
| | | | | | | | | | | | | FilterLayerEntityJob would not check for the enabled-ness of parent entities, if present. We introduce another job that checks for each entity, whether it is enabled or not. Jobs that need to access this flag must take care to add a dependency on the UpdateTreeEnabledJob Task-number: QTBUG-56235 Change-Id: Ic087fc8e9efdd4829cdb18ae3e8430344f6ecf43 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderViewBuilder: add dependency on technique filteringPaul Lemire2016-12-121-2/+3
| | | | | Change-Id: Icdc4f2b66454db9e585bf7bcf724811b18e86421 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add unit tests for RenderViewBuilderPaul Lemire2016-12-122-0/+471
Change-Id: I52b088804d836100b268a2b0998fe0a1cd86cf77 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>