summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash in scene2d at shutdownv5.10.1Määttä Antti2018-02-081-5/+8
| | | | | | | | | | | | | | | | | | | The resource manager policy for scene2d nodes has been changed so the scene2d constructor gets called multiple times at startup. That in turn increments render thread user counter every time. The cleanup code gets called for each instanciated QScene2D node so at shutdown the counter never reaches zero and the render thread is not closed properly. Change the implementation so that the counter gets incremented only when the render thread has been properly initialized. Task-number: QTBUG-66003 Change-Id: I33a5b1f407e65329776bcabe0b66ff049581a435 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> (cherry picked from commit 564dfd87c5b1317dcf9fbc4d1c8d858c72513421) Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix crash if sharecontext is requested before initailizationMäättä Antti2018-02-082-34/+42
| | | | | | | | | | | | | | Scene2D can sometimes receive the render initialization event before the qt3d renderer has been initialized. This causes crash because the sharecontext hasn't been set yet. Add safeguard against this. Task-number: QT3DS-904 Change-Id: Ib50a60ed89c12ac54c9165266466d9804affe77c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> (cherry picked from commit 13f340c92bdf725d214ab4840fc2e071d12d6e00) Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Ensure node creation changes are sent before using in list propertiesSean Harmer2018-02-083-2/+29
| | | | | | | | | | | | | | | | | | 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>
* LoadSceneJob: refactored to minimize code duplicationPaul Lemire2018-02-014-41/+72
| | | | | | | Also improve error output Change-Id: Ibf4a4340c83dadd507f4f356682cc861930fe2fd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make PickBoundingVolumeJob depend on ExpandBoundingVolumeJobSvenn-Arne Dragly2018-02-011-0/+1
| | | | | | | | PickBoundingVolumeJob uses QEntity::worldBoundingVolumeWithChildren(), which is set by ExpandBoundingVolumeJob. Change-Id: Ic03360a694254e45c9abfd6863a7b101910bb7fc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix OnDemand render policySvenn-Arne Dragly2018-02-014-95/+99
| | | | | | | | | | | | | 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>
* Make ShaderGathererJob depend on FilterCompatibleTechniquesSvenn-Arne Dragly2018-02-011-0/+2
| | | | | | | | | | | The ShaderGathererJob will use Technique::isCompatibleWithRenderer() while looking for dirty shaders. This is set in the FilterCompatibleTechniquesJob, but it might run after (or, even worse, at the same time as) ShaderGathererJob. Task-number: QTBUG-66024 Change-Id: I929e87b9c67068b51f7d64c637b1741d743b1839 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Organize dirty bits in categoriesSvenn-Arne Dragly2018-02-013-25/+41
| | | | | | | | | | | | | | | To get a better overview of which dirty bits changed at what time, this change organizes them in the following categories: - current: dirty bits at job building - marked: dirty bits marked since last job building - remaining: dirty bits set but not cleared in the previous frame Further, within renderBinJobs, we add a variable "notCleared" to keep track of which bits in "current" should be set in "remaining". Change-Id: I43a42a4fd495a6d9f794721d1f09381718dfa647 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Initialize the unused memberThiago Macieira2018-01-301-0/+3
| | | | | | | | | | | | | | GCC 7 complains that it is used uninitialized. The line number points to the opening brace of the class, so I suppose it's the implicit copy constructor. Loading undefined floating point values is probably a bad idea. Could generate an FP exception. animationutils_p.h:126:8: error: ‘<anonymous>.Qt3DAnimation::Animation::ChannelNameAndType::pad’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: I11d489f37e7e424b971dfffd150e3268d4be9294 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix warning about unused variableThiago Macieira2018-01-301-0/+1
| | | | | | | assimpimporter.cpp:616:75: error: unused parameter ‘basePath’ [-Werror=unused-parameter] Change-Id: I8d96dea9955d4c749b99fffd14cd62dd3d0fa45f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* SIMD: Disable on all windows x86 platformsPaul Lemire2018-01-251-2/+2
| | | | | | | | MSVC compiler reports internal errors on these code paths MinGW fails on float comparison Change-Id: I30c05dc242d2b3cee8c7158841c73a8d53a61e1b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* SIMD: Only include SSE classes if options activatedPaul Lemire2018-01-253-4/+14
| | | | | | | | | Relying on the SSE2 or AVX2 defines results in some SSE/AVX classes being included even though the options were disabled, resulting in compile failures. Change-Id: Ie1e3ce2f093eeb3f749ef215835fa0846fbb5019 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.9' into 5.10Sean Harmer2018-01-255-16/+86
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/cameralens.cpp src/render/backend/cameralens_p.h src/render/jobs/pickboundingvolumejob.cpp src/render/jobs/updatelevelofdetailjob.cpp Change-Id: I5433dde8ace462d11f037742d45f555c87235ffe
| * Doc: Add examples and enumeration to QCullFace documentationSvenn-Arne Dragly2018-01-251-4/+69
| | | | | | | | | | Change-Id: I0196e0305d205b7499c77644c0fdd42eb671a309 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Fix issues due to changes in camera view matrixMike Krus2018-01-245-13/+18
| | | | | | | | | | | | | | | | | | Picking relied on the transform matrix of the camera being the same as the view matrix. This has changed but picking and lod code was not update to use the new convention. Change-Id: I3250d3409d15e78a5c0b56eb3b1e74bce1e22843 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Replace Q_DECL_OVERRIDE with override keywordJesus Fernandez2018-01-231-1/+1
| | | | | | | | | | Change-Id: I153ff68ac60f88d3db8815e133c8851b05e1c130 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Doc: add doc to undocumented methods in qt3dNico Vertriest2018-01-241-7/+28
| | | | | | | | | | Change-Id: Icde8db3bb95f0275d820f5e0effa01ac2033134b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | SceneLoader: fix broken scene tree unloadingPaul Lemire2018-01-232-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add missing attribute types to GL 3.3 helperMike Krus2018-01-231-0/+9
| | | | | | | | | | Change-Id: Icda934e876b15f66d9121866c9f298ba9cc5b732 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | SceneManager: rename pendingSceneLoaderJobs()Paul Lemire2018-01-233-3/+3
| | | | | | | | | | | | | | | | Renamed to takePendingSceneLoaderJobs() as the name better indicates we are resetting the vector of jobs internally. Change-Id: I68a16139994552b7b26f1cf88a206a61a30950e0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge "Merge branch '5.9' into 5.10" into refs/staging/5.10Sean Harmer2018-01-224-24/+65
|\ \
| * | Merge branch '5.9' into 5.10Sean Harmer2018-01-224-24/+65
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/frontend/qcamera.cpp tests/auto/render/render.pro Change-Id: I8f848a1f863d07eecb328965fbe27d74b8d442f1
| | * LoadGeometryJob: fix uninitialized valuePaul Lemire2018-01-221-0/+1
| | | | | | | | | | | | | | | Change-Id: Ia70ebeed824cdea7127a7741082c7983c89ec731 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Deprecate viewMatrix() on QCamera because its name is misleadingSvenn-Arne Dragly2018-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The matrix returned by viewMatrix() is in a coordinate system relative to its parent, which is not the final view matrix used when rendering. The final view matrix depends on the world transform of the camera, but we do not calculate this on the frontend for performance reasons. We therefore deprecate this function because its name is misleading. Change-Id: Ib7891c13d83b4de43b86dde878994f66979ecb02 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Calculate and store real transform of camera in addition to view matrixSvenn-Arne Dragly2018-01-223-24/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to store the viewMatrix as returned by QMatrix4x4::lookAt in the transform component of the QCamera. This was unfortunate for two reasons: 1) An arbitrary entity could not be used as a camera without changing its transform to a viewMatrix, which breaks any other use of the entity. 2) Adding entities as children to cameras lead to the wrong transformation. This made it impossible to properly add objects that should be attached to the camera, such as the hands of a character in first-person view. This commit computes the transform of the camera based on the requested position, view center and up vector. The view matrix is calculated when the matrices are updated in the RenderView. This calculation assumes that the view direction is along the entity's negative z-axis and that the up vector is along the y-axis. Change-Id: If22b29e3d38bf55fbf79e9f7baf0c922e0a48aeb Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | LoadSkeletonJob: fix uninitialized valuePaul Lemire2018-01-221-0/+1
|/ / | | | | | | | | Change-Id: I51702b45b557ef14975be925760a5af48060f23b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2018-01-2210-10/+51
|\ \ | | | | | | | | | refs/staging/5.10
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-2210-10/+51
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp Change-Id: I691f54cd6daef8a966df37d447164c94badce34c
| | * AssimpImporter: disable default mirroring on texturesPaul Lemire2018-01-221-0/+1
| | | | | | | | | | | | | | | | | | Change-Id: I8fd5776b44faf36b08f3966f634d656d06b203a4 Task-number: QTBUG-64133 Reviewed-by: Mike Krus <mike.krus@kdab.com>
| | * Merge "Merge remote-tracking branch 'origin/5.9.4' into 5.9" into ↵Liang Qi2018-01-182-9/+20
| | |\ | | | | | | | | | | | | refs/staging/5.9
| | | * Merge remote-tracking branch 'origin/5.9.4' into 5.9Liang Qi2018-01-182-9/+20
| | | |\ | | | | | | | | | | | | | | | Change-Id: I9c8aa5d2010fcc622b9cce3031e58a46b74ea2fa
| | | | * Scene3DRenderer: ensure window pointer stays the same while renderingv5.9.4Paul Lemire2018-01-102-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that the pointer value for the window could in some cases be updated meanwhile we were rendering, which resulted in random crashes. We now save the window pointer to a member variable on startup or whenever the windowChanged signal is fired and use a mutex to ensure the pointer won't change while we are rendering. This also covers the case where the item is destroyed but the cross-thread signals are not received before rendering happens. Task-number: QTBUG-63897 Task-number: QTBUG-65407 Change-Id: I5f2797e2210b532f9086ed186959fce27ea9f514 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * | | Add unit test and fix for broken order of event deliverySean Harmer2018-01-181-1/+22
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure a backend node is always created before it is used in a property of any other node. This avoids a race between sending the creation, add child and property update changes and the start of a new Qt 3D frame. The race is caused by the use of the event loop to trigger the node created and child added changes. Also be careful not to repeat the node creation. Task-number: QTBUG-65829 Change-Id: I6ca5eb269ce657f8d42d855550fb4f898e3bd420 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Volker Krause <volker.krause@kdab.com>
| | * | Scene3D: allow to force blocking renderingPaul Lemire2018-01-167-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Scene3D, when the jobs preparing the render commands for the 3D scene take too long (more than the QtQuick refresh rate), the Scene3D wouldn't render anything when QtQuick requested it to. Then, the next time it would be asked to render (next QtQuick frame), if the jobs have finished by then, it will render. If the jobs are still not ready, then the above process is repeated. This patch introduces an environment variable SCENE3D_BLOCKING_RENDERMODE which can be set to force Scene3D to wait (for at most 10ms) instead of returning immediately for the jobs being ready. Change-Id: I2db10e622570a7bc8a2e2cbaff113c110135cd3e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * | Don't insert nullptr shader programs into the shader cacheVolker Krause2018-01-121-1/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | This can happen when the shader program fails to compile/link, and will subsequently trigger an assert in the shader cache. Change-Id: I4c4093d89a8a0f5ed1970012258be5efe8ec29c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Add function to apply channel defaults and call itSean Harmer2018-01-223-0/+12
| | | | | | | | | | | | | | | | | | Change-Id: If3c9515565acf2b1b2b361e07f9abb884c13dcb5 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Generate default channel values as neededSean Harmer2018-01-224-5/+53
|/ / | | | | | | | | Change-Id: I20871448ba10cf6459b156d00bebdf7a7c8a319b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | QMesh: do not rely on QAspectEngine to create QGeometryFactoryPaul Lemire2018-01-223-26/+81
| | | | | | | | | | | | | | | | | | | | | | - This would prevent QMesh created without parent/scene to have a proper geometry factory. - This avoid passing the engine around Change-Id: I5091970f96e87ab8b129475a1113ef84ce170388 Task-number: QTBUG-65506 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Add a function to calculate the default value for missing channelsSean Harmer2018-01-192-0/+72
| | | | | | | | | | | | Change-Id: Ic7bee59324da81fe2e467fd940029706297fc286 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Store more information in the ChannelNameAndType structSean Harmer2018-01-192-25/+57
| | | | | | | | | | | | | | | | | | | | | | This should be renamed in a follow up commit to something like ChannelDescription. This additional information is required to track where we need to substitute in default channel values for clips with those channels missing when building the blend tree format. Change-Id: I46ce9624fc887b1e902ad1a800c69637bdf9a163 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add getters for joint transformations to SkeletonSean Harmer2018-01-191-0/+15
| | | | | | | | | | | | Change-Id: I29e6dec8486f1e9efe709815615cb09ab5be5598 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | QResourceManager: fix coding stylePaul Lemire2018-01-191-6/+11
| | | | | | | | | | Change-Id: Ifbb512fd9e8bbdce4bd6ae91b8f9f23f429d56cd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Wrap up the format describing source clip and formatted resultsSean Harmer2018-01-1810-55/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need more information that just the source indices to be able to properly describe the transformation from the raw evaluation results of a clip, through to the formatted layout later consumed by the MappingData objects. The playback of a QClipAnimator still works but it seems that the process for properly blending animations is more complicated than previously thought. We cannot simply assume a default value of 0 for all channel components. If a clip has a channel missing but the user has still requested that this channel be evaluated (by way of a mapping or a subset of clips having matching channel data), then we must provide sensible defaults for those channel components. This deficiency will be dealt with in a following commit. Change-Id: I7d7d0f7ce19c545629bb347e1132fc4ed6a59d0d Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add function to return name of a jointSean Harmer2018-01-181-0/+1
| | | | | | | | | | Change-Id: Ia6fcf9014b25037c076e7dbce08941fb384ce527 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Don't clear the target indices vector when building the formatSean Harmer2018-01-181-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This will impact on the future format building when there are multiple clips to be blended. For now we fill them with -1 values and alter the check when building the channel mapping data structures. A follow up commit will make the input to this function immutable and instead output the masked off channels as part of the format which can be used to build the channel mappings. Change-Id: I7eb42041ccfe253a449f13fde89236eab56dba18 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix includes of Qt classesFriedemann Kleint2018-01-154-7/+7
| | | | | | | | | | | | | | | | | | Add the module name, which is required for PySide2 to build. Complements 1129ff731fca6aff5849cafe1f434f1882342cd7. Task-number: PYSIDE-487 Change-Id: Icb6057f6849825536aac4c8f340d722b87b77857 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Prevent potential containers detachingMike Krus2018-01-149-28/+45
| | | | | | | | | | | | | | Found by Clazy clazy-range-loop Change-Id: I4956f9be2b7b3f986b2fc83c1d883829314a8b6c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Iterate on references to avoid copiesMike Krus2018-01-136-6/+6
| | | | | | | | | | | | | | Found by Clazy clazy-range-loop Change-Id: Ib2d7f4073cbe7b5b2280518d5dc92981b56541cc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Iterate by const reference on handlesMike Krus2018-01-1319-37/+37
| | | | | | | | | | | | | | | | When iterating on handles, use const references to avoid copy of non trivial type. Found by Clazy clazy-range-loop Change-Id: I33ec54b3958160da2517e196411bcf92cd7b3bff Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Prevent use of temporary containersMike Krus2018-01-131-6/+6
| | | | | | | | | | | | | | | | Iterate on container, not on the list of keys. Found with Clazy clazy-container-anti-pattern Change-Id: Ie74e2355361747238f020771dae817ecc3b671d0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>