summaryrefslogtreecommitdiffstats
path: root/src/core
Commit message (Collapse)AuthorAgeFilesLines
* Refactor Scene3D to work with both RHI and GL Qt3D renderersPaul Lemire2020-07-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Depending on whether we are using RHI or GL we need to either trigger the rendering after the beforeRendering or beforeRenderPassRecording have been fired -> beforeRendering The RHI command buffer is set up but nothing has been recorded yet. This is what we want for the RHI backend but we will need to make sure we don't call begin/endFrame nor use swap chains other than the one QtQuick is using. This means RenderSurfaceSelector won't be possible. -> beforeRenderPassRecording The RHI command for buffer uploads have been uploaded but the actual RenderPass draw calls have yet to be made. The screen has been cleared already, so this is the best place for the GL backend which expects the screen to have been cleared. - The GL backend can use a QOpenGLFrameBufferObject but that is not possible with the RHI backend. - The RHI backend uses a custom QRhiRenderTarget that takes care of blitting its color attachment into a QRhiTexture which is then bound to a QSGTexture The overall Scene3DItem/Scene3DRender architecture remains the same: - processChange - Render Qt3D content into Texture - Set texture on a custom QSGNode quad Change-Id: Id6c317342d0a227d5295cbfefefc3ed12da160d7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QBoundingVolume: fix unitialized valuedPaul Lemire2020-07-271-0/+1
| | | | | | | Lead to some bounding volumes being invalid (negative of infinite radius) Change-Id: Ie2a5037eed744577139e7d301479c6639fca8e61 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update buffer visitorMike Krus2020-07-271-9/+36
| | | | | | | | Optimize iteration in non-primitive-restart case; remove code duplication. Change-Id: Ie459485c1cefc51956029e56e266a98c17d5b038 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix vS2019 build issuesMike Krus2020-07-202-6/+1
| | | | | | Change-Id: I5af5b180f7b07b885e613c20b84b9904d6906ed5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-0934-83/+79
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QList instead of QVectorJarek Kobus2020-07-0716-31/+30
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic726ce85e01190dbc64426388fd454c54ae3c3e3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderQueue: reset now destroys RenderViewsPaul Lemire2020-07-071-0/+16
| | | | | | | | This makes things tidier by tying RenderViews lifetime to current RenderQueue. Change-Id: I35ef5761cf987582c361d700efce8ef06231ff38 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: replace QVector by std::vector wherever possibleJean-Michaël Celerier2020-07-071-0/+14
| | | | | Change-Id: I0020df0a0ce3b53e62dd9e4e5faad92583f9dbcc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update RHI plug-in with std::vector changesJean-Michaël Celerier2020-07-032-0/+74
| | | | | Change-Id: I2a4952ac086916fcdca80845ea74d9140ee597db Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-0213-25/+32
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Input Aspect: Dispatch events directlyMike Krus2020-07-012-9/+17
| | | | | | | | | | | | | Rather than accumulating events during a frame, they are now directly delivered to the device handlers synchronously. This removes the need to use jobs for updating the nodes. Updating axis and logical devices remains done using jobs at every frame. Change-Id: I2853a72cfe68201d8a6eb44d37bc64c9f50efd4f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* CalcBoundingVolumeJob: use std::vectorPaul Lemire2020-07-012-5/+7
| | | | | Change-Id: Ibc2b3669c14102dc07dcbd9032e45403986b8a73 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove unused codeMike Krus2020-06-291-7/+0
| | | | | Change-Id: Ic4b2de774e1b3f3e94b4e560e003718d2c20adfd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Update docs with cmake package informationNico Vertriest2020-06-291-0/+1
| | | | | | Task-number: QTBUG-85179 Change-Id: I774714579f27d460533fc3a3280ff604306e5529 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* CalcBoundingVolumeJob: use QtConcurrent if available and Qt3D max thread ↵Paul Lemire2020-06-241-1/+2
| | | | | | | | | count > 1 Seems to be leading to some deadlocks otherwise Change-Id: I5bc7dd3e851bf6e6c26fda3088d4946512fcc6a5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-249-23/+23
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I2e126d0be8efa0aa89c4a91a681b549f38c8cec4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean input event handlingMike Krus2020-06-231-1/+0
| | | | | | | | | - Clean up header dependencies - Remove EventSourceSettingHelper as threading is no longer an issue - Remove some locks which are no longer needed Change-Id: I071173d3b4c681f5420bd7a1f4cb13f80a9c9b2f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix AVX2 AlignedAllocatorPaul Lemire2020-06-192-1/+93
| | | | | | | | | | | The allocators should also be part of the SIMD specific files that have special compile flags. Use this opportunity to move aligned_malloc from Qt3DRender to Qt3DCore so that any file in any module relying on it gets the proper compile flags. Change-Id: I7e18aeb195e9d34d4917be4ecccabfd82e40c0dd Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix compile warningsMike Krus2020-06-171-93/+0
| | | | | Change-Id: Ibb17168e1c75c4802764e2ccfb3dd6d8257402dd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode: remove property tracking modePaul Lemire2020-06-175-121/+0
| | | | | | | This serves no purpose since the synchronous synching was put in place. Change-Id: I4509cc348168d614388f73a26f8420b26629ace6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix handling of SSE/AVX sourceMike Krus2020-06-171-3/+44
| | | | | | | | | | | | | | | | QtBase has macro to enable SSE handling on specific source files. But Qt3D has some classes which use those specific instruction set in headers, so any file that includes those should also have the right command line options. This adds the right command line arguments to the 3DCorePrivate target so that anything that depends on that will have the right options. 3DCore is fine because it knows about the special headers files which were tagged. Change-Id: Ia061750121fb2ab5c93600c08a5464179ca2c228 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make sure bounding volume gets updated in main threadMike Krus2020-06-171-5/+3
| | | | | Change-Id: Icb640217f101538c7564472422837c3da687757b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix compile warnings related to deprecations or unused variablesPaul Lemire2020-06-081-2/+2
| | | | | Change-Id: I3d8fa0940a22f40bec3809b302cc59a40a5c3c52 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix QBuffer documentationPaul Lemire2020-06-081-9/+1
| | | | | Change-Id: Id612f8a2e2408265a0c2ac87e9a31aac41a60582 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix QBuffer::updateData being called several times in a rowPaul Lemire2020-06-082-1/+12
| | | | | | | | | | | | QBuffer::updateData would send a single update at the time and would overwrite the latest update if it was called again before synching with the backend took place. This patches fixes by storing a list of pending updates instead. Change-Id: I1fc501ad921c953ec88117fcc49c0cfcde6ca8aa Task-number: QTBUG-81921 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix buildGiuseppe D'Angelo2020-06-031-1/+1
| | | | | | | | moc in Qt 6 needs the type to be fully declared and not just forward declared. Change-Id: I4af9b067cbb245e4358ff77653c63e6c79274240 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add API compatible with QMatrix4x4Mike Krus2020-06-012-0/+8
| | | | | | | | The SSE / AVX Matrix have API which is not compatible with QMatrix4x4. Added operator()(int, int) and use that instead. Change-Id: I41328805da3b1003273e526f4eedbd035d18fb97 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add missing overrideAlexander Volkov2020-05-251-1/+1
| | | | | Change-Id: I6a2a4577b4c45d7ac601d2693044c3817e245111 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for building with CMakeMike Krus2020-05-222-0/+207
| | | | | Change-Id: If6c887c6356a160a5f3fb906d38a341fff0c7b29 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QResourcesManager: switch to std::vectorPaul Lemire2020-05-201-3/+3
| | | | | | | | | Given QVector is potentially slower for this use case and the fact that QVector might become QList in Qt6, we're better of using the std. Change-Id: If2c403439ddb856b60f8bfd5ae7c6ec1cb2c892a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Silence a few warningsMike Krus2020-05-191-1/+1
| | | | | | | | Missing override, unused variables and functions. Also fixes qHash API in QNodeID. Change-Id: Ieb223eb2464780f79050372040f418bb2360c8d5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Centralize the maxThreadCount informationPaul Lemire2020-05-072-11/+17
| | | | | | | | | | | Add a static function on QThreadPooler which returns the ideal thread count (capped by QT3D_MAX_THREAD_COUNT) if set. Call that function from all places that need that information. Avoids code duplication and potentially reading the env value every frame. Change-Id: I699691af33ed0a65aa557ed48aabb9de8929dcc2 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix build for Qt6Mike Krus2020-05-0612-6/+588
| | | | | | | | | | | | | - updated dependencies, excluding qtgamepad for now - fixed issues with Q_PROPERTY not supporting forward declarations - fixed for changes in QtQuick private API - fixed for changes in QtOpenGLVersionFunctions API - fixed for removal of QT_OPENGL_ES* macros - fixed for changes in QtConcurrent API - fixed RHI based build Change-Id: I42ccd2f101b7f0a78e2860c6d551722bf6710a11 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-04-277-18/+22
|\ | | | | | | Change-Id: Id669d5c1aab29965eac0dabd1cb497e908dac23e
| * Fix compilation on Windows with -qt3d-simd avx2Paul Lemire2020-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | Q_3DCORE_PRIVATE_EXPORT for operator* were removed by commit: fa6799f63f3211300705b814b97716ca689d4bfa for Vector3D_SSE and Matrix4x4_SSE. Unfortunately they weren't removed for Matrix4x4_AVX2 which lead to different linkage compile errors. Change-Id: I854fb0cb4409aea1d130e935091533d4e72d6d6e Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * Animations: fix race condition on running clip animators vectorPaul Lemire2020-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | Was caused by incorrect dependencies on the jobs. Introduced a clearDependencies on QAspectJobPrivate to clear all dependencies as removeDepencies(emptyVector) only removes null dependencies. Change-Id: I8119a9edaf841db6c5ab2a971dc5640da2192cba Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * Don't look up backend node if frontend not updated yetv5.15.0-beta3Mike Krus2020-03-311-0/+2
| | | | | | | | | | | | | | | | | | If node parent / child or entity / component changes before the backend nodes where created, records might not be complete yet. Task-number: QTBUG-82269 Change-Id: Id8238410331626130bb71bb1653ac5cb5d5270d4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix scene graph dumpMike Krus2020-03-201-8/+9
| | | | | | | | | | | | | | Might have QNodes "between" parents and child entities. Change-Id: Ie041508ec96c39b779bc75a6ad4d38c604e322e2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Make QAspectJobPrivate::isRequired() constPaul Lemire2020-03-174-7/+7
| | | | | | | | | | Change-Id: I8747c5714b4a25523835d558fa96888ea0ebcfed Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * Initial creation of RHI plug-in and refactoringJean-Michaël Celerier2020-03-161-1/+1
| | | | | | | | | | Change-Id: Ifbb51003e15f798798040597b5f7224641e8147c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update documentationMike Krus2020-04-231-5/+146
| | | | | | | | | | | | | | And clean up old code Change-Id: I5ff1be15d0f17450f68c1510e7b42eab3e15ea2d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add ability to override bounding data and trigger calculationMike Krus2020-04-235-49/+113
| | | | | | | | | | | | | | | | | | | | With this, can set min and max extents of a geometry renderer which will avoid calculating it from the real geometry. Can also trigger the computation from user code (via public API) if user doesn't want to wait for next frame to get the data. Change-Id: I821bfb7c9d710a77a2b87ec607b4ed35a0c7f236 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Pull bounding volume info from front endMike Krus2020-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When an entity has a bounding QBoundingVolume component AND that has a QGeometryView, the bounding volume can be computed by the core aspect and the results get pulled to the render backend. Otherwise, we use the old code which computes the bounding volume in the render aspect. This means we have 2 jobs to compute bounding volumes and that the core version must complete before the render aspect runs. Change-Id: I4de45e48fa0c4d40d3d5084f387abfed5ea1a2f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add bounding volume calculations to core aspectMike Krus2020-04-2214-11/+1233
| | | | | | | | | | | | | | | | | | | | | | If an entity uses a QBoundingVolume and a QGeometryView, compute the bounding volume data in the core aspect. All other cases will still happen in the render aspect. Result not currently used (ie it's done again in render aspect). Change-Id: I4b5ed21bac42b79777c3112aa76d876ac5b6f52d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Introduce QCoreAspectMike Krus2020-04-097-0/+273
| | | | | | | | | | | | | | Does nothing for now Change-Id: I94310a893c3be430aa3d36948c07e0d50efe6c8a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Introduce QBoundingVolume classMike Krus2020-04-084-0/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Used to query the bounding volume of a geometry view (currently not computed, needs jobs in core aspect). Will later enable explicitly setting the bounds if known (to avoid the computation). GeometryRenderer derives from BoundingVolume to keep existing scenes working. User will be able to have both a GeometryRenderer and a BoundingVolume component on an entity, could use different (simpler) geometry for bounding volume computation. There's an private flag which tags the primary provider (in case there's several), it's false by default for GeometryRenderer instances. Change-Id: I53711b4138718b0802c2a2fccd52b6c8ec16e7ca Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Introduce abstract API to lookup front end nodesMike Krus2020-04-076-11/+163
| | | | | | | | | | | | | | Useful later to write simpler tests Change-Id: I164b0e46eed5f341629895d7f7b0c3af75999fbd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Track dirty state on front end nodesMike Krus2020-04-0718-1/+153
| | | | | | | | | | | | | | Nothing clears the state yet, will be up to the core aspect to do that. Change-Id: Ia3a5297a4b837b1d67545bd29ddce56666c520f3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-03-042-5/+20
|\| | | | | | | Change-Id: I4c86ac3ec0b86e3bbb5733c7dfad1100e7780e40
| * Fix memory leaksMike Krus2020-03-042-5/+20
| | | | | | | | | | | | | | | | | | | | | | Some jobs get skipped because they don't have anything to do. However, since the runnable does not get submitted to the pool, it would leak (along with the job it points to). Also fixed a couple of compile warnings. Change-Id: I7a25649f2f760c0593862328c0ab905da98c982a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>