summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Rework resource handlingLars Knoll2017-11-073-144/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the way the QResourceManager allocates and manages it's resources. Get rid of the huge pre-allocated freelist, and instead merge it with the counter field (that is now always a quintptr large). Give QHandle a direct pointer to it's data in addition to the counter. This makes QHandle 8 or 16 bytes large, but speeds up access to it's data and gives more safety on the counter as that one now always has at least 31 bits. Counter and the linked freelist use the same memory location. To avoid potential conflicts, make sure the counter is always an odd number, so it can't be a valid pointer. Do not use INDEXBITS anymore, the resource manager can now always allocate as many resources as we have RAM available and will grow with the required use (and not allocate fixed memory upfront). This change reduces the memory consumption of the qardboard example from a bit above 40 to 10MB. Change-Id: I514f2d3f957f8635098fb88342e42e3361456340 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Deal with trailing spaces and crlfKevin Ottens2017-11-071-0/+4
| | | | | | | | | We ended up having corrupted meshes if the application which exported the OBJ was adding trailing white spaces. Also make sure we got a test case using crlf for end of lines. Change-Id: Iace9dbc3d0d124fefe9e3350d396fdf26555cd17 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix SortPolicy sorting key generationLaszlo Agocs2017-10-203-4/+29
| | | | | | Change-Id: Ib06d84088d93e00ffdcaa6baa9d34e03358943cb Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Add doc for undocumented methodsNico Vertriest2017-10-201-0/+6
| | | | | | | | qanimationclip.h:56: warning: No documentation for Qt3DAnimation::QAnimationClip::clipData Change-Id: Ic44c96d47d3dff095b6b299f5280f21345dba452 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented methods/propertiesNico Vertriest2017-10-205-4/+346
| | | | | | | | | | | | | | qtexturewrapmode.h:60: warning: No documentation for 'Qt3DRender::QTextureWrapMode::WrapMode' qtexturewrapmode.h:55: warning: No documentation for 'Qt3DRender::QTextureWrapMode::x' qtexturewrapmode.h:56: warning: No documentation for 'Qt3DRender::QTextureWrapMode::y' qtexturewrapmode.h:57: warning: No documentation for 'Qt3DRender::QTextureWrapMode::z' qtexturegenerator.h:59: warning: No documentation for 'Qt3DRender::QTextureGenerator::operator()() qtexturegenerator.h:60: warning: No documentation for 'Qt3DRender::QTextureGenerator::operator==(const QTextureGenerator &other) qtexturewrapmode.h:60: warning: No documentation for 'Qt3DRender::QTextureWrapMode::WrapMode' Change-Id: I6a77f43dfb153de142d12ef1c3cdb1850669d49f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented classesNico Vertriest2017-10-205-1/+21
| | | | | | Change-Id: I342a74f6605d7e6a9ac6f07af21dc8f7fd80c3ce Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Render next frame if texture data is not availableHarald Vistnes2017-10-093-3/+11
| | | | | | | | | | | | | | | Texture data from generators may not be available in the current frame and the next frame should be rendered immediately, even in OnDemand rendering. The problem was that this information was not propagated back to the renderer, it was just silently ignored inside GraphicsContext::setParameters. Added a bool return type to GraphicsContext::setParameters so that the renderer could check for errors. Task-number: QTBUG-63561 Task-number: QTBUG-59752 Change-Id: I18fb6f8236bf47d3eeab07d879dffaa599665e6b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.9.2' into 5.9Liang Qi2017-10-062-2/+2
|\ | | | | | | Change-Id: I8d6bb938f7ad06fa97898f4242af76cb48efbfc5
| * Make m_pressAndHoldTimer into a raw pointer to avoid deleting it twiceSvenn-Arne Dragly2017-09-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | The timer is parented to the QMouseHandler (introduced in 595b4add0ce6f32bb8ffc56b3a59e6e5bf0b000a) and was therefore deleted both by the parent and by the QScopedPointer, leading to crash on exit. This commit removes the QScopedPointer and uses a raw pointer instead. Task-number: QTBUG-63462 Change-Id: I6b031caf7cb69ccbde74995661f4ce8c73f21d88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix race in rendererPaul Lemire2017-10-061-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | All buffers are uploaded to GPU before the frame submission takes place. If during frame submission we check for a CPU buffer whether it's dirty, we end up (rightfully) with a race condition as we are preparing for frame n+1 already. There must have been a left over when the above changes were made as the UBO/SSBO code paths would, during rendering, check whether a CPU buffer was dirty, and if so try to upload, causing a race. Removed these code paths which aren't needed. Change-Id: I713a92b881335ecfb30f24bd7485a7bac29be4b7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix reformatting of clip evaluation resultsSean Harmer2017-10-051-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | This now correctly handles both the old ChannelMapping and the new SkeletonMapping use cases. There was some ambiguity about which way around the indices were being generated. It worked in previous cases for the limited data available to test with. This has been tested to work with both the JSON animation format and skeletal animations loaded from JSON and glTF 2 files. Change-Id: Ie8558c764cd8dc57d6cdad19bbc6a66052bc68d0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Improve debug output for fcurvesSean Harmer2017-10-051-6/+19
| | | | | | | | | | Change-Id: I4a9044933b182a2e0eba745483f1b8bc214dcdba Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Remove unused buildPropertyMappings() overload and testsSean Harmer2017-09-292-61/+0
| | | | | | | | | | | | | | Everything goes through the other overload now. Change-Id: Id0c196a6967a9f83e47092ca1fc7f4ab4ebe9309 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | Move the non-blended animation codepath closer to the blended oneSean Harmer2017-09-294-15/+39
| | | | | | | | | | | | | | | | | | Will make it possible to reduce the amount of code to maintain and test. There are still several ways to optimize this too so best to only do it for one code path that all animators use. Change-Id: I05ebd4f41d88aa0bea37d4d17130bc79c96ebd5c Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | Add unit test for FindRunningClipAnimatorsJobSean Harmer2017-09-291-1/+9
| | | | | | | | | | | | | | Should pass before and after the refactoring. Change-Id: I9ef8f948f03a131546fc6485e9c66494ff383714 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add convenience function to ChannelMapper to return list of MappingsSean Harmer2017-09-272-0/+32
| | | | | | | | | | | | | | | | Caches the resolution of node ids to ChannelMappings. Updated test to check this new feature. Change-Id: I0c2f539c2bd91e7918b98c5b60c9ca486b63ec08 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Ensure meshName gets used in the functorSean Harmer2017-09-271-2/+4
| | | | | | | | | | Change-Id: I9015546607b5663f1feada64bc03cb73d3538ef2 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Actually get matching clip indices for componentsSean Harmer2017-09-261-7/+6
| | | | | | | | | | | | | | | | | | | | | | Rather than assuming they are in order. The blended clip animator code path now behaves the same as the simple QClipAnimator in that it can handle clips with channel components not in the expected order. We can now look at making both share a common code path. Change-Id: I61848e07b4f418ba9f4c56f56f4f49c9a5fbd588 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Avoid deep copy in loopSean Harmer2017-09-261-1/+1
| | | | | | | | | | Change-Id: I5a86547ae669394c290b30427f98821bc7552a63 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | Fix gathering clip value node idsSean Harmer2017-09-262-1/+5
|/ | | | | | | | This correctly handles the case where the blend tree consists of a single value node. Added test case to catch it. Change-Id: I8982d2081748866d163f107a4513bd2d17feb83a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Copy size and pixelRatio when switching activeFrameGraphAnders Hafreager2017-09-241-1/+4
| | | | | | | | | | | | | Copy externalRenderTargetSize and surfacePixelRatio from old to new surfaceSelector when setting activeFrameGraph on RenderSettings. Previously, when switching activeFrameGraph, surface was copied from old to new surfaceSelector, but these other properties were not. The rendered image was then stretched until window is resized again. Change-Id: I62b78da05c764f981813ab96b9a769bae7d786b2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't crash objgeometryloader on ill-formed face, just ignoreWieland Hagen2017-09-221-1/+1
| | | | | | | | For < 3 vertices, array accesses would fail, and face creation not make sense anyways Change-Id: I5eb746dfdec92d1c836e9870d87e7900530ec81c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Clear TextureData flag after texture uploadWieland Hagen2017-09-151-0/+1
| | | | | | | Or else we will continue uploading data indefinitely Change-Id: If81d8a0a790964c699462fbcb166808ee7859f59 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix bounding sphere pickingMike Krus2017-09-121-8/+12
| | | | | | | | | | In some cases, the list of pickable objects may contain entities that don’t have an object picker (or not parent has). Now filter the pick results to only keep entities which either have an object picker or are children of an entity that does. Added unit test which now passes Change-Id: I930c3d60cf2d19e845fe6c0de904c53b93ebe8be Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Get rid of the AllocationPolicy template argument in the ResourceManagerLars Knoll2017-09-1111-88/+28
| | | | | | | We always use the same policy anyway. Change-Id: I3349b8c19ce0e6239b140dfac7ba66f8dda1b9be Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Get rid of the HandleManager classLars Knoll2017-09-115-354/+86
| | | | | | | | | Instead, direclty use the Allocator to acquire and release handles without an additional indirection. This removes around 30% of the overhead in run(). Change-Id: Ic4a9343dd52a900eb1c7eb6b4135bc7670076df1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove ArrayPreallocationPolicyLars Knoll2017-09-111-54/+1
| | | | | | | It's not used anywhere Change-Id: Id65ec9fc8e38697c0dbd23fe4f816e1637a22483 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix logic errorLars Knoll2017-09-091-1/+1
| | | | | | | | | This should be removeAll instead of remove(). Remove takes an integer (index into the array). It compiles by chance (but doesn't do the right thing), as QHandle has a cast operator to int. Change-Id: If8d59a535021bab3d2553f83bef7cf769c738dd6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make GLTexture dirty flags atomic instead of using a mutexWieland Hagen2017-09-082-21/+33
| | | | | | | | | | | | | The mutex right now is used for controlling access to the m_dirty flags, and for guarding access to m_gl and other data. We don't need to use it for accessing the flags, as an atomic int will do just fine and relieve us of potential deadlocks. The mutex must only guard changes to the actual data. Task-number: QTBUG-61130 Change-Id: Ia1f25af2233387f375c077965e901c67f972f1ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Re-build Blend-Trees when Clips have been loadedWieland Hagen2017-09-088-1/+61
| | | | | | | | | | | | | | | We need to notify the BlendedClipAnimators, when any of the clips it depends on have been loaded. So we register each animator at the clips that it depends on, mark the animator dirty when the clip has been loaded and thus trigger a re-run of the BuildBlendTreesJob. Make sure to guard accesses to the Handler via mutexes, because backend objects can be marked dirty from various threads. Task-number: QTBUG-61941 Change-Id: I4890d0d76d3118538537252f920d9477bed8f934 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Qt3DQuickWindow: Instantiate QQmlAspectEngine after aspectsWieland Hagen2017-09-081-1/+1
| | | | | | | | | | | | | | | If not, some aspect's library might not have been loaded yet, when the QQmlAspectEngine is created. This means that their static aspect registration code will not have been run, causing the QAspectFactory to not include it in the defaultAspects when it is created. Following calls to QQmlAspectEngine::registerAspect() will fail, because the engine was created too early. Change-Id: I96dc8a972dc4fbd1cf3a8d2d91067d59e0d72e57 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Properly handle byte strideWieland Hagen2017-09-081-1/+1
| | | | | | | | If a specific byte stride is given by the user, we should expect that he knows how the buffers look. Change-Id: I0ee9a92bf628d3f3fda935e9cd83e7c1150cd089 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Return the Uniform as a const reference to avoid expensive copiesLars Knoll2017-09-062-12/+2
| | | | | | | And inline the nameId() and uniform() getters. Change-Id: I4c30a6fa36a6e5a7e621d3fad91d88adfcfda185 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix StringToInt implementationLars Knoll2017-09-062-47/+19
| | | | | | | | | | | | Reduces the overhead per call of lookupId() from around 7000 to 180 instructions for a use case. Should in general scale much better. I still do not like that this is using global static data that is never cleaned up. It should be tied at the minimum to the lifetime of the Qt 3D scene. Change-Id: I777a2bbf2d765f4b0fc9e3d2b06692c7260f5a9f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Improve performance of FilterKey comparisonSvenn-Arne Dragly2017-09-062-14/+10
| | | | | | | Reduce the number of copies and make sure the types are compared first. Change-Id: I6bdd411b6e16ef0f92a32de9733d737aab73835b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Improve dependency look-upChristian Strømme2017-09-069-342/+45
| | | | | | | | | Simplify the dependency look-up by moving the dependers directly into the dependee runnable, each task is then responsible for updating their dependers and queue them up when they are free to be run. Change-Id: I96295d47cecd507a864965e1fb65f2ff9af68111 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* GraphicsHelperGL2: Remember to set raw byte sizeKevin Ottens2017-09-061-0/+25
| | | | | | | | | | | If one ended up with this helper then the applyUniform would lead to a divide by zero for any type. As a side-effect, the support for more matrix types needed to be done for unit tests to keep passing. Change-Id: I66c8a2eb7e5617f2fed96c689cb4ebc024ef9853 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't create GL textures when format is not setMauro Persano2017-08-312-1/+12
| | | | | | | | | | | For textures where the format was not set (this may happen, for instance, for a Texture2D without TextureImage children), don't try to create a GL texture or the underlying OpenGL calls will fail. Also avoid trying to set the corresponding uniform while rendering. Change-Id: I17d95e2a2f1f1a1e5c22a0296c8641c4873e9e7f Task-Id: QTBUG-62654 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: add missing doc QGeometryNico Vertriest2017-08-301-0/+18
| | | | | Change-Id: I9d1fef3f793f9d3eb4ef0bb3fff356539fc03e2c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented methods/propertiesNico Vertriest2017-08-304-11/+23
| | | | | | | | | qmorphphongmaterial.h:57: warning: No documentation for 'Qt3DExtras::QMorphPhongMaterial::interpolator' qextrudedtextmesh.cpp: No documentation for 'Qt3DExtras::QExtrudedTextMesh::depth', ::font and ::text qextrudedtextgeometry.h:79: warning: No documentation for 'Qt3DExtras::QExtrudedTextGeometry::indexAttribute', ::normalAttribute and ::text Change-Id: Ib6bb0310be3b9e3a735bb90194a79dfb295c258b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix hover event handlingMike Krus2017-08-301-2/+9
| | | | | | | | | HoverMove is not a QMouseEvent. So we generate a fake one and send it for picking processing. Task-number: QTBUG-58607 Change-Id: Iaa06bfe49494db1a46cc021747fd5d0026330525 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: add doc to undocumented methods qt3dNico Vertriest2017-08-294-12/+34
| | | | | | | | | | | | | | | qabstractlight.h:65: warning: No documentation for 'Qt3DRender::QAbstractLight::Type' qspotlight.h:64: warning: No documentation for 'Qt3DRender::QSpotLight::attenuation()' qshaderprogram.h:78: warning: No documentation for 'Qt3DRender::QShaderProgram::Status' qshaderprogram.h:121: warning: No documentation for 'Qt3DRender::QShaderProgram::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)' qpicktriangleevent.h:57: warning: No documentation for 'Qt3DRender::QPickTriangleEvent::uvw' Change-Id: Iedb73cc73bc28a5e9dd3498a0bb6547eb1a96ffc Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented methods/propertiesNico Vertriest2017-08-284-1/+10
| | | | | | Change-Id: I8967110b0237421299c2103f847a38e0526f9a6b Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QMouseHandler: Add a parent to the internal timerGuilhem Vallat2017-08-252-0/+9
| | | | | | | | | Without it the timer is leaked and doesn't follow the mouse handler when move from a thread to another. Task-number: QTBUG-62779 Change-Id: I34afc36165d2bbbce626d6c2c74f9408a319a7cb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix shader linking error on RPI/BRCMSergio Martins2017-08-251-3/+9
| | | | | | | | QOpenGLShader::link: ERROR:OPTIMIZER-3 (fragment shader, line 46) Support for for loops is restricted : right side of condition expression must be constant Task-number: QTBUG-59349 Change-Id: Id5806e597642e0805ef02fa1804ec4a9a8e4338c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't dereference null vaoSergio Martins2017-08-251-2/+4
| | | | | | | RPI doesn't support vao Change-Id: Icfcf90c6aff53a73704cc36c215b7b452be86778 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix crash when loading multiple assimp scenesMauro Persano2017-08-242-84/+43
| | | | | | | | | | | | | | | | | When a second scene is parsed, the importer for the first scene is destroyed, and geometry renderers and materials in the parser's maps are released, causing a crash. Instead of converting all meshes and materials to Qt3D entities ahead of time and storing them in maps, only convert entities that are needed by the scene. Task-number: QTBUG-62390 Change-Id: I1261d0dd01ced43b2731fdfe97b97885883dca9b Reviewed-by: Massimo Callegari <massimocallegari@yahoo.it> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Remove ill-timed viewVec-upVec check in QCameraLaszlo Agocs2017-08-241-2/+0
| | | | | | | | | | | | The check for parallel view and up vectors is well-intentioned, but it cannot be done this way: the view matrix is updated already after setting any of position, view center, or up vector. The (failing) check can thus be triggered right after setting a position or view center that (temporarily) results in a vector colinear to the (not yet final) up vector. Change-Id: I083200bf05582517880a88816b7987874810c2bb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: add doc to undocumented methods qskyboxentity.cppNico Vertriest2017-08-211-1/+16
| | | | | | Change-Id: I3056be52f9203fbd99a3e5c01de71d79bafd2298 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Complete QML documentation for QAxisAccumulatorPaul Lemire2017-08-181-0/+18
| | | | | | Change-Id: I839196116a5b4d70fa0545c0c6fd28079efeebca Task-number: QTBUG-61993 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>