summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix MSVC warning about inconsistent DLL linkage of QAnimationClipData ↵Friedemann Kleint2021-01-291-4/+4
| | | | | | | | operator==/!= Pick-to: 6.0 Change-Id: I8e63400ca2b2d6d7963b8ea6f111e6e9026f1278 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix a number of MSVC int conversion warningsFriedemann Kleint2021-01-2922-56/+56
| | | | | | | | | | - Port the qHash() functions to size_t - Add some casts - Adapt some types Pick-to: 6.0 Change-Id: Ib889d46dd56c1a1c4bf6b87ae1f756c188069180 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make Qt3DWindow handle default surface format more gracefullyMike Krus2021-01-272-10/+26
| | | | | | | | | | | | | | | | | | The default is now to use the same rules as QtQuick. If nothing is specified, will use RHI and the best surface for the platform (Metal on Mac, DX on Windows, Vulkan if available, etc). If Qt3D's OpenGL backend is requested via QT3D_RENDERER, will always use OpenGL surface. If QSG_RHI_BACKEND is set, will honour that if possible. Otherwise will use the API requested in the constructor (which defaults to using auto detection). Pick-to: 6.0 Change-Id: I8941a081940c073dfcf66711a8628e8ef6fd0915 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix light uniforms not properly being updatedPaul Lemire2021-01-272-1/+8
| | | | | | | | | | | | | | | | | | - We cache commands and only rebuild them when really needed. When we rebuild then, we also store the mapping between uniform location and parameter name - When reusing a command, we only update the uniform values but expect the mapping between to remain the same. - When dealing with lights however, we can end up in a case where the light type changes, and therefore so does the shader data associated. The command remains cached as nothing really requires a rebuid. Yet, this means we could have more or less parameters than the number of mappings we have stored previously if the shader data defines more or less properties. To account for this, we now rebuild the mapping when building the command or if the number of parameters in the parameter pack is different than at the previous frame. Change-Id: I9400fc7e5bcb4b97ac9da69cdf794010cf81103b Pick-to: 6.0 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Only declare staticVulkanInstance if QT_CONFIG(vulkan)Paul Lemire2021-01-271-0/+5
| | | | | | | | | Should hopefully fix compile issues on platform when vulkan isn't found. Change-Id: Ia54486dc160960e0e7000c7de832f154ecee8b0c Task-number: QTBUG-90243 Pick-to: 6.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update qt/qtquick3d-assimp submoduleJani Heikkinen2021-01-181-0/+0
| | | | | | | | Fixes: QTBUG-89433 Change-Id: Iec372c94b541f871f3ed78843656c2dfa1a1f613 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> (cherry picked from commit 5d4a3edca84eab4453165f7d90d786a2b914f58e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix parameter priorization documentationAntti Määttä2021-01-185-21/+30
| | | | | | | | Pick-to: 5.15 Fixes: QTBUG-64110 Change-Id: I09330ba29b0c120d6e7e0ae0b2bf8d4e388054e1 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up use to QVector vs QListMike Krus2021-01-111-7/+7
| | | | | Change-Id: I797f52d7cf4f55b5991448c0498e0b149a3dd7c6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QtQuick API to build with 5.15Mike Krus2021-01-1116-4/+78
| | | | | | | Haven't tried to run anything, it just builds Change-Id: I6c2c2a949bc3892a363697cf38f1608af87c303c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove QFrameAllocator (again)Mike Krus2021-01-1113-596/+11
| | | | | | Push-to: 6.0 Change-Id: I03ff6cab88d5bb0d279a61fa0a730f32b088b481 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Port QText2DEntity to use std::vectorMike Krus2021-01-114-35/+40
| | | | | Change-Id: I98febe2ae6500f2eaf44b489283f597c3c20c272 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Convert QExtrudedTextGeometryPrivate to use std::vectorMike Krus2021-01-111-22/+21
| | | | | Change-Id: I3fa63c558033488122c8c2ff60d4b9cd33cdbf2b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up error loggingMike Krus2021-01-111-43/+49
| | | | | | | | Making it more readable and add details of failed FBO creation. Pick-to: 6.0 Change-Id: I14a65a5ed6165597acc52f38dc5d1cb908732911 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Handle changes in QMetaType APIMike Krus2021-01-087-1/+57
| | | | | | | Updates to support building with Qt6 and Qt5.15 Change-Id: I9f06d810c943a348e6a060f4ea35ed870f21694a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use correct Y axis orientationMike Krus2021-01-081-1/+1
| | | | | | Pick-to: 6.0 Change-Id: I9a4075312db7c385d3ba49176dea8ca0c06061a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QQMLPropertyList APIMike Krus2021-01-0863-1622/+1226
| | | | | | | Use lambdas with local typedefs for index type Change-Id: I2876c71d619815e7e777f936e8bb0835b8269336 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Categorise warningsMike Krus2021-01-081-4/+4
| | | | | | Pick-to: 6.0 Change-Id: I3b074a02ff47e33472d9506c6dccab281f555e74 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Qt3DWindow::setupWindowSurface set QT3D_RENDERER env variable if unsetPaul Lemire2021-01-071-6/+16
| | | | | | | | | So that anything relying on that env variable to detect the Qt3D rendering backend gets a valid value. Pick-to: 6.0 Change-Id: I291ec03720fd6127900f43888a7e40ab382a075a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Drop use of QVector in GLTFSkeletonLoaderMike Krus2021-01-052-24/+24
| | | | | Change-Id: Iacb06149178f02811885f6fbee88713894b5a7b6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Drop use of QVector in MovingAverageMike Krus2021-01-052-3/+4
| | | | | Change-Id: Iba91d91d4fcd292d1e1bb388db63800893c59fc8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Enable compiling non-QML API against Qt 5.15Mike Krus2021-01-0511-8/+27
| | | | | | | | | | | | Built with QtQuick disabled. - C++17 required - minor issues with QList vs QVector - QMutexLocker templated vs not - moc forward declaration handling Change-Id: I5540625e74e2c009e528f56203e4b88be8d54599 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Restore use of QVector in private APIMike Krus2021-01-0545-198/+196
| | | | | | | | Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* qpicktriangleevent_p.h Add missing private API warningPaul Lemire2021-01-041-0/+11
| | | | | | Pick-to: 6.0 5.15 Change-Id: I57f758f279d62ee4508914d12f99ee68cd41a2c7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-2215-25/+25
| | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in Qt3D. As the two are synonymous, this patch should have no impact on users. Task-number: QTBUG-86829 Change-Id: Ie63323a692e8937fa72f0225b48ccb703f479c47 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Load rhi backend by defaultPaul Lemire2020-12-181-1/+1
| | | | | | Change-Id: I2c907539e1071aa511d0a25b21bb9ed476a471c0 Pick-to: 6.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Print warning about using primitive restart on ES2Mike Krus2020-12-171-0/+5
| | | | | | Change-Id: I6007f1e152e38948b619cdeada84a86f7f4db4e4 Pick-to: 5.15 5.12 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RHI: compute viewport based on rendertarget sizePaul Lemire2020-12-161-6/+7
| | | | | | | | | | | So that behavior is consistent with the OpenGL renderer. Computed viewport size is QViewport::normalizedRect * current render target size. If current render target is the window, then its size is the same as the surface size. Change-Id: Icd8f8e18d8959ac045538b493fef690e3dd7221c Pick-to: 6.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Doc: Fix qdoc syntax errorNico Vertriest2020-12-161-2/+2
| | | | | | | | Warning log: qshaderprogram.cpp:253: (qdoc) warning: Missing '\endcode' Pick-to: 6.0 Change-Id: I63079eef0f277e9c6fd9a718bc40d7fecb5676e6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Clean up configuration of Extras moduleMike Krus2020-12-151-3/+3
| | | | | | Pick-to: 6.0 Change-Id: I6ba2720dcda886cc91953f74054ca81ebd52b0df Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix plugin names for 3DInputMike Krus2020-12-151-1/+1
| | | | | | Pick-to: 6.0 Change-Id: Id80723870cd8b8a3d333c14a98e233d7e87ffab1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* CMake: Fix .prl file generationJoerg Bornemann2020-12-151-6/+6
| | | | | | | | | | | | | | | Work around QTBUG-89467 by re-ordering the add_subdirectory calls in src/CMakeLists.txt. The qmake project file looks correct. It's not entirely clear why pro2cmake generated this particular call order. But by now it's not worth fixing anymore. Also, the .prl file generation should not depend on the order of add_subdirectory calls in the first place. Fixes: QTBUG-89412 Pick-to: 6.0 Change-Id: I899608d8abe829e1b71ca9aa87734361947137f9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix feature names in cmakeMike Krus2020-12-111-14/+14
| | | | | | | | | | | | | | | | | | | | Feature names were mistakenly changed to use underscores rather than dashes. This breaks builds of apps using qmake as it changes the feature detection symbols. Fixed by reverting to use dashes in the names. This is fine in cmake as dashes are converted to underscores when not quoted. Unfortunately, it changes the command line configuration arguments back to the dashed versions. [ChangeLog] Configuration time command line arguments have changed to use dashes rather than underscores Change-Id: If793c5424aa0459daf06dd075e2e40c33997ca1a Task-number: QTBUG-89386 Pick-to: 6.0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix binding of CubeMapArray texturesJim Albamont2020-12-113-6/+6
| | | | | | | | | | | | | | To bind to a specific face: use glFramebufferTextureLayer and calculate the layer as 6 * layer + face. To bind to a specific cubemap: There is no way in OpenGL to directly bind to an entire cubemap within the array. Instead bind to the entire texture as for a CubeMap with AllFaces. It is up to the drawing code to select the right cubemap and face, 6 * layer + face Change-Id: Ib9e1a598503eeba1fa729677944aba6d799f90b2 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add missing sampler types and sizes to gl4 helpersJim Albamont2020-12-111-0/+11
| | | | | | | | | | | | | | | | | In particular the CubeMapArray and CubeMapArrayShadow were missing from the call to get uniform size causing a crash when these sampler types were used. While fixing this, I double-checked the samplers types in uniformByteSize uniformTypeFromGLType buildUniformBuffer and made sure they were consistent Change-Id: Ief91952fd7727945ba1c4156fe053587a4060684 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix sampler2DArrayShadow uniform in QShaderGeneratorJim Albamont2020-12-111-1/+1
| | | | | | Change-Id: I3fefbe93b58c8bc695a15022204806abcc5ff127 Pick-to: 5.15 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix disabling shader cache via environment variableJim Albamont2020-12-101-1/+1
| | | | | | | | | | | | The tests were a broken too because the QT3D_DISABLE_SHADER_CACHE environment var was still set from the previous test. These tests passed before because the shader builder used the cache if either the QT3D_DISABLE_SHADER_CACHE or QT3D_REBUILD_SHADER_CACHE are not set. Change-Id: Ic04bf3bb8bb7b9b27e3dc9663fe5e96647a3bed4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit fd5c3299553818e99421f54c1b819681335de9aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QShaderProgram: fix documentationPaul Lemire2020-12-101-2/+2
| | | | | | | | | was using \code instead of \endcode Change-Id: I63794533a3cf2593e9a47fc0b4f97f1b65c88f3f Pick-to: 6.0 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Add documentation for RHI portingPaul Lemire2020-12-073-0/+408
| | | | | | | | Also add details about GLSL 450 code on the QShaderProgram documentation. Change-Id: I8222984fc655ecf4d7be3d163cdd1d04988c4250 Pick-to: 6.0 6.0.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderProgramBuilder: add documentation related to cachingPaul Lemire2020-12-071-0/+32
| | | | | | Change-Id: Icdab60d721a0a5186fe3e8844f40e2e448eb94d5 Pick-to: 6.0 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Force command filtering based on frustum culling resultPaul Lemire2020-12-011-2/+5
| | | | | | Change-Id: I9def719816548d45e1235cb4f65bf0c0d6d0f405 Pick-to: 6.0 6.0.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix deadlock when running with QT3D_MAX_THREAD_COUNT=1Paul Lemire2020-12-0111-66/+30
| | | | | | | | | Also remove duplication and make QAspectJobManager::idealThreadCount the centralized function to retrieve expect maximum number of threads. Pick-to: 6.0 6.0.0 Change-Id: Iec8d65d368ac7825ef87e883a987551726603adc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* OpenGL renderer: fix use of outdated VAO when shader is reloadedPaul Lemire2020-12-013-7/+27
| | | | | | | | | | | | | | | | In a case where an existing shader was updated, VAO previously associated with the shader wouldn't be updated properly. To account for this, we now release all VAOs associated with a shader when loading a shader. Additionally we also skip VAO creation of commands referencing a shader that was loaded in the current frame. The reason for that is we know the command for that VAO is not completed. Qt3D requires a first frame to load a shader + perform introspection and creates valid command against shader only on the following frame. Pick-to: 6.0 5.15 Change-Id: I36f89fdd78e857dc5bc4af3b539d3b32630dfad6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI: restore QBufferCapture featurePaul Lemire2020-12-012-8/+5
| | | | | | | | | Also fix manual test to import Qt3D.Core 2.9 since QBuffer was moved to core in Qt 6 and accessType property was introduce with revision 9. Pick-to: 6.0 Change-Id: I449f413fd161fe4660cef61708cd641e429c1c81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Convert containers to use std::vectorMike Krus2020-12-017-73/+72
| | | | | Change-Id: Id1445c48761890836f965bee5c28df9b17e1fca4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Handle API changes for event handlingMike Krus2020-12-015-6/+35
| | | | | | | QMouseEvent position getter is different between 5.15 and 6 Change-Id: I45fd7a1350624f725bd35c5ea33f7da75d8f31a1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add RHI technique for distance field rendererMike Krus2020-11-302-0/+21
| | | | | | Change-Id: Ia69dceb8ade566c2b67ce681b7b554e0babb17f2 Pick-to: 6.0.0 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RHI: handle uniforms of type arrays properlyPaul Lemire2020-11-283-1/+37
| | | | | | | | | | | | | | | | | | | We weren't handling the possible array stride for uniform arrays. For a float[8], the GPU might expect each float to fit in a vec4 slot. We therefore have to handle that when uploading the values otherwise we could end having data in what the GPU believe is padding data. This required modifying the UniformValue object to report the number of elements it contains as it might not necessarely be the same as the array dimension reported by the shader introspection. Note: it seems that the arrayStride might not be reported properly. To work around that, if we know we are dealing with an array, we compute the stride ourselves. Pick-to: 6.0 Change-Id: I12b5379927dd47be888a40db58c2e5aba6e0730b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Handle changes in OpenGL classesMike Krus2020-11-274-0/+36
| | | | | | | Support building against both 5.15 and 6 Change-Id: I46e15f2f898f5f2304075e290798d3d2aea47dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Allow assimp to compile on non-gcc compilersJoni Poikelin2020-11-271-1/+1
| | | | | | | | | | Gcc 4 version check can also be dropped since it is not supported anymore. Fixes: QTBUG-88821 Pick-to: 5.15 6.0 Change-Id: Ice522afc92823156e9545e8e75b16c2c0a614d6f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Only set the state flag after having merged with the other statesPaul Lemire2020-11-261-1/+1
| | | | | | Pick-to: 6.0 6.0.0 5.15 Change-Id: Ic7a0a2cccb2b131eec7fca3cf7324109b4d22b6b Reviewed-by: Mike Krus <mike.krus@kdab.com>