summaryrefslogtreecommitdiffstats
path: root/src/core/resources
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-239-178/+178
| | | | | | | | | | | This reverts commit 03e5f60e585701608c1181365faee484d7a1f14c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I359e89ed77b1b2750607617d138ebb6c316f0296 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-029-178/+178
| | | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qt3d. Examples, documentation files or tests are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4155 Change-Id: I139c8ad72c042b0900239decc36cfed4bc1c4951 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* QResourcesManager: switch to std::vectorPaul Lemire2020-06-041-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> (cherry picked from commit 04bdb35a6c5f5fe417c06392e6a0861d80ec9dba)
* Make the OpenGL renderer a pluginPaul Lemire2020-02-051-30/+9
| | | | | | | | By default the QRenderAspect will try to load this plugin Change-Id: Ie55e207fb8e6d0b64f717bbb99699eb669eaa3f2 Task-number: QTBUG-61151 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix usages of text stream operatorsAlexandru Croitor2019-12-061-4/+4
| | | | | | Change-Id: I8f3fe9475749f10f33c8eb750befa8845ccc37d6 (cherry picked from commit 58db7d01e0d424fdf46baa70e2e41b8009429c78) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Don't try to load binary json GLTF data if !QT_CONFIG(binaryjson)Ulf Hermann2019-11-071-0/+2
| | | | | Change-Id: Ic42a59c1dfea50ba152922bf4edbddc64b2d0f73 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Accept CBOR as optional format in gltf dataUlf Hermann2019-10-292-0/+79
| | | | | Change-Id: I8e64f061147af10a0d017238664c483724047059 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Coverity warningsMike Krus2019-10-211-0/+2
| | | | | Change-Id: I00c875b48d838170fddf0b92f0ac5592828c6f0f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Switch export macros to standard formKai Koehne2019-04-022-2/+2
| | | | | | | | | | | | Qt expects the export macros to have Q_ prefixes, otherwise the symbol versioning script won't find them and mark them. Also remove non-exising QT3DLOGIC_PRIVATE_EXPORT macro from src/doc/qt3d.qdocconf Task-number: QTBUG-74752 Change-Id: I71b9e85ff09c002fb283824aa51a5a8f50e937f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QResourcesManager: remove simd code from headerPaul Lemire2018-02-283-18/+57
| | | | | | | | Rather move the simd code to a .cpp file that gets compiled once with the proper flags Change-Id: Ifc28eed844ef94224f45d0e307046a1cb884bf14 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Render: Use SIMD Vectors and Matrices in the backendPaul Lemire2018-02-021-2/+23
| | | | | Change-Id: I19b3b2f8fcb06eb2bc600ebe370465dd15a8eabc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QResourceManager: fix coding stylePaul Lemire2018-01-191-6/+11
| | | | | Change-Id: Ifbb512fd9e8bbdce4bd6ae91b8f9f23f429d56cd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Get rid of the INDEXBITS template argument for QHandleLars Knoll2017-12-132-35/+31
| | | | | | | | | It's not required anymore, as the resource manager can grow as needed. Change-Id: If509de7f2ef90e1af9729d8fc60d7ecb08ede687 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rework resource handlingLars Knoll2017-11-072-143/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Get rid of the AllocationPolicy template argument in the ResourceManagerLars Knoll2017-09-111-10/+6
| | | | | | | 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-114-351/+84
| | | | | | | | | 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>
* Fixes includes to comply with coding conventions for Src/CoreRobert Brock2017-03-315-23/+27
| | | | | | | | Reordering the header includes to comply with Qt coding conventions Task-number: QTBUG-56185 Change-Id: I3943678c183c4ef46d403e0fff878c3cad964dfa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-252-17/+25
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/core/resources/qframeallocator.cpp src/plugins/sceneparsers/gltf/gltfparser.cpp src/render/frontend/qrenderaspect.cpp tests/auto/render/renderqueue/tst_renderqueue.cpp Change-Id: Icdc2be2c80e7de6135a09e2f370ee004e395f514
| * QFixedFrameAllocator: Extract Method scan()Marc Mutz2016-10-242-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code used indices to detect when it fell off the end of m_chunks and needed to allocate a new chunk, but this was opaque to Coverity, which saw the potential for m_lastAllocatedChunk == nullptr at the end of the function, and thus reported a nullptr deref there. Fix by moving the scanning of m_chunks into a new method, scan(), which more clearly communicates that it never returns nullptr, not least because it returns by reference instead of pointer. Coverity-Id: 154279 Change-Id: I0cfe8fd819bbfc5b03a98b5e9354c0e98a521d34 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | HandleManager: do not allow counter to overflowPaul Lemire2016-08-111-0/+3
| | | | | | | | | | | | | | | | This could otherwise have happened if an element was acquired and released repeatedly. Change-Id: I29a327f32fdd9d9a02460bff26c9ff56fdd3dd61 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Silence warning C4189 with MSVCSean Harmer2016-08-081-0/+12
| | | | | | | | | | Change-Id: I823ee47bec06874cdb67c9862b3eaa71cc727952 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-0/+3
|\| | | | | | | Change-Id: I34a98a52cb30084471fd329e36cda7f64bf0af08
| * Replace “#define private public” with a proper friend class declarationDmitry Shachnev2016-06-201-0/+3
| | | | | | | | | | | | Change-Id: I98a31d165367e725c902df368c9c2824439a47d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Insert a void cast to silence Clang -Wdynamic-class-memaccess warningThiago Macieira2016-05-081-1/+1
| | | | | | | | | | | | | | qresourcemanager_p.h:177:20: warning: destination for this 'memset' call is a pointer to dynamic class 'Buffer'; vtable pointer will be overwritten [-Wdynamic-class-memaccess] Change-Id: Id75834dab9ed466e94c7ffff144489ec85f57f00 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QResourcesManager: allow to retrieve all active handlesPaul Lemire2016-06-301-1/+9
| | | | | | | | | | | | | | | | This will allows to simply jobs and have more efficient computing by avoiding tree traversal Change-Id: I7198f4919ab5b770bc0f1b95df402cbbae47f813 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix memory leaks in render node managersAntti Määttä2016-05-261-0/+10
| | | | | | | | | | | | | | | | | | | | Delete objects in node managers. Task-number: QTBUG-47978 Task-number: QTBUG-51035 Change-Id: I55167dfa8c7b76ed6405bcb2b3bc775ca0152a5b Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Mark more types movable/primitive/sharedMarc Mutz2016-05-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | Text size savings on optimized GCC 6.0 Linux AMD64 builds: Core: 192B Logic: 128B Input: 872B Render: 4936B Change-Id: Id9de0e49a24a2f056d2543c60b10fde7a8ca989b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Q_NULLPTR -> nullptrSean Harmer2016-05-014-24/+24
| | | | | | | | | | | | Task-number: QTBUG-52736 Change-Id: I58f9cbcdf018e7b672d33dd865067485412b79fe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add debug operator for QResourceManagerSean Harmer2016-04-171-0/+37
| | | | | | | | | | | | | | | | Useful for dumping out the resource tables to debug issues on the backend. Change-Id: I8f140d544b208b0b6006e08da6d36e031e781b2a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add debug operator for QHandleManagerSean Harmer2016-04-171-0/+32
| | | | | | | | | | Change-Id: I706b735235d2dd6ef8949dad1f0b3297275927ee Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Improve function name in QResourceManagerSean Harmer2016-04-151-3/+3
| | | | | | | | | | Change-Id: I81b5959ec3e03413830cf382a16018b585a3e9f0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Rename hash within QResourceManager to better describe its purposeSean Harmer2016-04-151-7/+7
| | | | | | | | | | Change-Id: I91331ce95acaa24c4e768d90d5a32d1e2e75b597 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Rename template parametersSean Harmer2016-04-151-28/+28
| | | | | | | | | | | | | | | | | | | | T -> ValueType C -> KeyType Makes the code more readable. Change-Id: I3fbdfe01afd21f1e94d7e5a0d0c8f8870869ab1b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | core: eradicate Q_FOREACH loops [low-risk]Marc Mutz2016-02-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves 8.3KiB (2.8%) in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I5fae547c8a3a0a4c5467b967da55470d353f0ba8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Use integer comparisons when filtering entities by layerSean Harmer2016-02-221-0/+2
| | | | | | | | | | | | | | | | Followup commit will split this phase out to avoid recursion in rest of the render command building. Change-Id: Ifa7cd7f2cea82c34bb827b3f114c442660d2598b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | QResourceManager: use QReadWriteLock instead of QMutex when possiblePaul Lemire2016-02-201-17/+83
| | | | | | | | | | | | | | Should minimize lock contention once the new QReadWriteLock lands Change-Id: I5dcab094943134fa81696b5fe106d6587730a579 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix copy and paste error in allocatorSean Harmer2016-02-191-1/+1
| | | | | | | | | | Change-Id: If006edd357dc6963c9e0240440fb07c67e7ac461 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix iOS context initializationMike Krus2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | When using QQ2 (but not Qt3D), Qt3D will create it’s own QOpenGLContext. This needs to participate in the global shared context setup. Also fixed a number of Clang related compile warnings Change-Id: I946521193470b768850208c7aa75f0ffb51d9e1a Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-263-26/+47
|\| | | | | | | | | | | | | | | | | Conflicts: src/doc/src/qt3dcollision-module.qdoc src/render/frontend/qcamera.cpp src/render/frontend/qcameralens.cpp Change-Id: I8a0ae250a6b8e065a1ef3c817968ebb7ef23b20d
| * Doc: Mark the rest of the private classes \internalTopi Reinio2016-01-262-4/+4
| | | | | | | | | | | | | | | | | | | | Private headers are no longer part of the documentation build, so the documentation for these classes triggers a lot of QDoc warnings. Avoid this by replacing the QDoc comment blocks '/*!' with standard C comments. Change-Id: Id7aac9354e12ba2b7a62f84b947a5f6f38702c6d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Doc: Exclude private header files from the documentation buildTopi Reinio2016-01-251-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | In the documentation configuration, exclude all '_p.h' files from the documentation build. This prevents QDoc from generating documentation for private classes, and also allows removal of documentation that explicitly set the private classes \internal. Change-Id: I8fcf5c99a2a0b75e9ee5dcd928fa4a2b4b8cf34f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix resource leaks in ArrayAllocatingPolicy.Volker Krause2016-01-191-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we ended up with default constructed elements in the bucket, and were constructing new ones for every allocation. As some of the types used in here allocate resources in their ctors themselves we were leaking those resources. Now we only construct each element at most once, and we don't construct any element that is never used. The resulting re-use of elements exposed the missing cleanup method in tst_ArrayResource. Change-Id: Ie875fea3ebc9b6f96d0239a6064474fbea798814 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Unify license header usageAntti Kokko2016-01-269-99/+126
|/ | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I8eac0cd6bbc276a56df487249cc459c0d4fab165 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Remove unused ListAllocationPolicy.Volker Krause2016-01-122-74/+0
| | | | | Change-Id: I59a6461fd3e81d578af3cc33248fb21d8b503135 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make QFrameAllocator privateKevin Ottens2015-12-085-160/+170
| | | | | Change-Id: Id69a161da691322184d8ec5ed7a1b375cf2038ed Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QResourcesManager: use const in NonLocking LockerPaul Lemire2015-11-161-1/+1
| | | | | | | Fixes compilation issue under MSVC Change-Id: I71b2fb68222d23a4f83e33dbf78820e7c2d9d6bc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* d-pointer classes, private/public changesTomi Korpipää2015-10-304-10/+32
| | | | | | Change-Id: I4ca133aebad0c088296ab293f95f0a6d76d18395 Task-number: QTBUG-39946 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Move the doc artifacts outside of the submodule directoryVenugopal Shivashankar2015-10-281-1588/+0
| | | | | | | | | | | | The qdocconf now lives in 'src/doc' because the documentation project defined by it covers the whole Qt 3D module. This change enables qmake to use 'qt3d' as the output directory for doc make targets. The new 'doc' directory also includes the relevant images, snippets, and the qdoc files. Change-Id: Ibc6d0912f8b1e665767e97630b3e5509e10c5710 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-139-36/+36
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>