summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix deprecated API usage and compile warningsMike Krus2020-11-2038-149/+131
| | | | | | | | | - QVariant::Type deprecated, use QMetaType related APIs - QNodeId not used as reference in for loops (nop but really noisy) - some unused code Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Follow up on change of QQmlListProperty to qsizetypeMike Krus2020-11-2062-170/+169
| | | | | | | | | Also update dependencies and fix non-gui builds. Disabled (for now) gltf unit test since JSON parser seems to crash. Change-Id: Ie7fdd9626653e89ad43e8bdb22b0e764618b1e9e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-092-2/+2
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: I10b2aaebfb49d1e289d663ddff042425ce772991 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Normalise configuration nameMike Krus2020-11-093-19/+19
| | | | | | | All others use qt3d_ prefix Change-Id: Id0405591a0fcfe62c8a510c9c226e85190d9a4cf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add mipmaps count to QAbstracTexturePrivateJuan José Casafranca2020-11-053-0/+3
| | | | | | Pick-to: 5.15 Change-Id: Iaec05eb3d7d8647af14d2e155673dd25c3dae994 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix taking pending texture data updatesJuan José Casafranca2020-11-051-1/+2
| | | | | Change-Id: Iea9fee79797bf005938d13436d83726c1c7c837a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make ObjectPicker optional for Scene2DMichael Brasser2020-11-041-23/+25
| | | | | | | Don't require it if mouseEnabled is false. Change-Id: I901e53b9df2f51e507af3c4423ebd71b253d1a6b Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix GLTexture cleanupPaul Lemire2020-11-041-0/+1
| | | | | | | | | | The GLTexture class wasn't registered for cleanup on the manager. This could result in it being reuse while not being reinitialized resulting in incorrect rendering. Change-Id: I85e6a5c3b5ca9d3cfa5ac5bcb1db3695dabfa576 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Check if texture upload is full sizedJuan Casafranca2020-11-031-6/+23
| | | | | | | | | This allows to upload full sized compressed textures which was not working before if using the TextureDataUpdate API Pick-to: 5.15 Change-Id: Ic87e99e60e56d5a10550ca8efdc4f75a7ae1f0b1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Handle invalid entity names in QSceneLoader::componentMichael Brasser2020-11-021-0/+2
| | | | | | | | Return nullptr rather than crashing. Pick-to: 5.15 Change-Id: Ie11fe798e0bcd3bfdfda053331eabf9ed16e3d94 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add dedicated Qt3D.Renderer.ShaderCache logging categoryPaul Lemire2020-11-023-6/+17
| | | | | | | | | Might come in handy to troubleshoot issues with the ShaderBuilder caching of generated shaders. Change-Id: I2ccb68608857fa86ff20cb95047d38497df4b3ad Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-11-0249-315/+315
| | | | | | | | Since we have long depended on C++11 now, all of these can go. Change-Id: I8808af2cd5ce192864c636b521dadd7de189563b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Finish removing traces of Scene3DViewMike Krus2020-10-283-12/+1
| | | | | Change-Id: I450e53cc716235db1bc0675c904466050e17296d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add caching mechanism to ShaderBuilderPaul Lemire2020-10-283-5/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a 2 level cache system: runtime and offline First we now generate a hash key based on unique features of a graph, the api it targets, the last time the graph file was modified. We then use that hash key to at runtime check whether we have already loaded a graph matching the same hash key. If that's not the case, we switch to using the offline cache and checking whether a file already exists for that shader or not. If the file exists, we load it, use the code it contains and add it to the runtime cache. If the file does not exist, we revert to actually generating the shader and we save the generated code to both the offline cache and the runtime cache. By default, the offline cache with try to write into the location reported by QStandardLocation::writableLocation(QStandardLocation::TempLocation). Optionally, the environment variable QT3D_WRITABLE_CACHE_PATH can be set with a path to a writable location. If QT3D_REBUILD_SHADER_CACHE is not empty, cache will be regenerated. Alternatively if QT3D_DISABLE_SHADER_CACHE is set, cache will be ignored. Pick-to: 5.15 Change-Id: Ia348f92ce4cdd5e63ec89e58b7954d1f127f26bb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make QAbstractFrontEndNodeManager privateMike Krus2020-10-279-12/+36
| | | | | Change-Id: Ic12bc80a00e887a959c6cb27e72be0422d71b254 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Pass the raw data to the texture data extractorJuan José Casafranca2020-10-273-6/+7
| | | | | | Change-Id: If6ca151b22f442985df1ff34108ca0bd216ebf47 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 6fdf835639e56c68ae01da894c7d2b9f552dd87d)
* Fix compilation with latest QMutexLocker changedPaul Lemire2020-10-261-1/+1
| | | | | Change-Id: I0991a7df7b4c8444030bfb6a551a87ff94e7e2fa Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update QShaderFormat matching logic to account for RHI shader snippetsMichael Brasser2020-10-231-0/+3
| | | | | | | | | OpenGLCompatibility/NoProfile should not match RHI shader snippets. Task-number: QTBUG-85018 Change-Id: Id56656c7d6d64884092595d125e8f65178e5b9f8 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Document how the font is used for extruded textMichael Brasser2020-10-232-0/+16
| | | | | | Pick-to: 5.15 Change-Id: Ib18adc0809948092beaad6511bfddc68f22cc459 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Expand QPaintedTextureImage documentationMichael Brasser2020-10-221-2/+15
| | | | | | | | Also make use of the newly documented pattern in the manual test. Pick-to: 5.15 Change-Id: Idefe271eea345848af3817e08ac5b45946843dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Document the origin of extruded textMichael Brasser2020-10-212-0/+8
| | | | | | | | | Many other mesh types use the center as the origin, so be explicit that extruded text is different. Change-Id: Iab443fab7a0e3a3f0a05dfcc7f17a837f69b2ae8 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Trigger an update on the quick window when creating a render aspectSean Harmer2020-10-211-0/+3
| | | | | | | | | | | | | Sometimes if a scene is large there is a timing issue that prevents Qt Quick from knowing it needs to do an update. When creating a new RenderAspect give the QQuickWindow a nudge to force an update. Pick-to: 5.15 Change-Id: Id0bd597ac8845ec5d9c89c7aa00ad57ae6b0056d Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Render enough frames to flush the Qt3D pipeline when dirtySean Harmer2020-10-212-4/+19
| | | | | | | | | | | | Sometimes Qt3D needs 2 frames if it involves introspecting and then compiling shaders. So render at least this many frames when needed. The change in formatting is pushed upon us by the clang-format use in the pre-commit hook. Pick-to: 5.15 Change-Id: Ie9f48876351a8d1a7bd0df705a9e43831753ac69 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI: fix face index for texture uploadPaul Lemire2020-10-201-1/+1
| | | | | | | | | Needs to be an index between 0 - 5 and not the GL enum value. Fixes crash when QAbstractTexture::updateData is called. Other code paths that use Texture Images already had that fix in. Change-Id: I2390d71e23d8d481e3d212942dd11a4fd31958ef Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI: add warnings when pipeline resource bindings mismatchPaul Lemire2020-10-201-1/+31
| | | | | | | | | | | | | We use introspection to generate the resource layout of the RHI pipelines. However, at runtime, we build the resource binding set based on what was provided for the material. In case, some parameters are not provided (typically samplers), the RHI backends might complain. Therefore we add a warning about which parameter is missing to help users diagnose the issue (except for the envlight uniform samplers which are automatically set by Qt3D). Change-Id: I0b8ea8ff1691a8603342d6f3c2c12134985e805f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Avoid multiple animation updatesMike Krus2020-10-161-3/+6
| | | | | | | | | Check that the handle is not already in the lists. Avoids doing the same updates several times in the Pick-to: 5.15 Change-Id: I385b150de23a2ae7f2274c7d7350a065bb0c34f5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adapt to platform API renameMike Krus2020-10-101-1/+1
| | | | | | | Task-number: QTBUG-87314 Change-Id: I0b0321a7a592ca4350cffcd5e2aaf3441cbf4735 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use internal CMake APIMike Krus2020-10-0724-55/+55
| | | | | | Task-number: QTBUG-86815 Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix QtQml integration for basic typesMike Krus2020-10-074-292/+937
| | | | | | | | | | | | Adds registration for QVector2D, QVector3D, QVector4D, QQuaternion, QMatrix4x4 and QColor types so that QML API can be used without requiring to import QtQuick. Replaces old private API with registered extension classes. Change-Id: Id5e98175c986bf125e4c3c9476a09e438793bad2 Task-number: QTBUG-87184 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RenderView: remove warning about no CameraSelector being setPaul Lemire2020-10-071-2/+0
| | | | | | | | | | | | It is after all valid in some cases to not have a CameraSelector (simply clearing the screen, blitting, rendering directly in normalized coordiates ...). While the warning might be useful for beginners, it results in the console being flooded with warnings when one of the above listed valid cases is performed. Change-Id: Id26625f35519f7afd405384289db5c4a11b95465 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QFrameGraphNodePrivate: add private exportPaul Lemire2020-10-051-1/+2
| | | | | | Pick-to: 5.15 Change-Id: I7dbff87a1b7a00d4fb6d7b558c38fa6fe5d2cdd5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make DebugOverlay accessible from QMLMichael Brasser2020-10-022-0/+31
| | | | | | | | Register and document QDebugOverlay. Change-Id: I357918ce3448c451d796f88656ec287bf03ffcfd Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix OpenGL ES 3 shaders for QDebugOverlayMichael Brasser2020-10-021-3/+5
| | | | | | Change-Id: I72185e825d20aad7c05e4870074831efa199972d Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix the assimp scene parser clausev6.0.0-alpha1Sean Harmer2020-10-011-1/+1
| | | | | | | | So that it actually gets disabled whwn specifying -no-assimp. Pick-to: 5.15 Change-Id: I23c166ef977103f2893c8df721a29d8d147badde Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix a crash when node is added and destroyed immediatelySean Harmer2020-10-011-0/+5
| | | | | | | | | | | | | | When a node is added to the scene it is scheduled for a post-creation initialization. However, if the node is destroyed before this post-creation queue has been processed we will crash. This commit ensures that the node being deleted is removed from the post-creation queue. Usually the queue will be empty and so this should not add a performance penalty. Pick-to: 5.15 Change-Id: Ibe4289e1e54cdb145f8588f15dc4ad894e427582 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Only set the format to 1.0 if it was not changed due to OpenGLAndy Shaw2020-09-301-1/+1
| | | | | | | | | | | | | Since the userRequestedApi variable can be set when a second Qt3DWindow is created (since the environment variable is set after the first time). Then we should be sure to only set the format version to 1.0 if it was not already set due to OpenGL being used. Pick-to: 5.15 Fixes: QTBUG-86436 Change-Id: Ib68f5f1f7f8651c1f20b66060fead7f3dcfb97e0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Only use surfaceSize if m_surfaceSize is not validAndy Shaw2020-09-301-1/+1
| | | | | | | | | | | This amends 2e3607aa120324f60832ca1cd42aaeaf22cc148d which made it always use surfaceSize. But if m_surfaceSize->size() is valid then this should be used as it will account for HighDPI setups. Fixes: QTBUG-86721 Change-Id: I634b6c3257ac2dcf8042acbbeb999960f68bb266 Pick-to: 5.15 5.12 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Update qml dependencie and adjust value providersPaul Lemire2020-09-281-210/+98
| | | | | Change-Id: I6dad0a179aacc3ec3a0ed6e43b92c589554deb5c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add missing QSequentialIterable headerPaul Lemire2020-09-281-0/+1
| | | | | | Change-Id: I58693eeeba78be65ff5f112d377480ecd6216a15 Task-number: QTBUG-87002 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Allow to specify a functor to extract data from QTextureImageDataJuan Casafranca2020-09-283-0/+26
| | | | | Change-Id: Idd052f6c24665a1accd2cd681c80fe74846e5c39 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Allow to set alignment requirement for an imageJuan Casafranca2020-09-284-6/+32
| | | | | Change-Id: Ifffbfd80a3d99b43e348e12bea62e3c90eed80c4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix animation not runningMike Krus2020-09-253-21/+21
| | | | | | | | Previous fix for compile issue forgot to account for the fact that the data changes after being registered with the class. Change-Id: Ice5238221f190f758ec3f25d883c56877c185e1c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update frontend data after jobMike Krus2020-09-251-0/+7
| | | | | | | | | | | Data computed by the core aspect needs to be available for the render aspect when it runs. This forces the update to the front node from the job thread which should be save currently since the main thread is blocked, there's no other core aspect jobs running, and the render aspect job depends on this one. Change-Id: I9483066d272eec02456f9c02f8e4a34acad35e0b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Add Qt 6 changes filePaul Wicking2020-09-242-0/+47
| | | | | | Task-number: QTBUG-84051 Change-Id: Ic7b798b13596d376bdcf52b2a6d17672ee20698d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Only release context if we own itMike Krus2020-09-231-1/+2
| | | | | | | | | | Otherwise we release the context that is owned by the QtQuick rendering engine which leads to assert failures and crashes in the single threaded case. Change-Id: I5f5e03bbe43a0990a29d41b2fc96e714668d85fc Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add QNodePrivate::registerDestructionHelper for std::vector containersPaul Lemire2020-09-231-0/+10
| | | | | | | | | Ideally should support generic containers but clang seems to fail to generate the symbol on the mac. Change-Id: Ic1d6d815ab9aff60a97b3b0047228f55d7efe158 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QML type providers following recent changesPaul Lemire2020-09-211-172/+0
| | | | | Change-Id: I8a976e25dc3123f1665e09c75fb3ad81d28d7c68 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderCommands: try to resolve API shader at command build timePaul Lemire2020-09-182-5/+31
| | | | | | | | | | | | This ensures that if a commands keeps being rebuilt, it will be usage for the current frame, assuming the shader exists. This aligns the RHI renderer with what the GL renderer does. The instanced-arrays-qml is a good way to verify that a command that keeps being rebuilt is rendered correctly. Change-Id: Ie9e574e98efeec6eb836af613d28cbf4cdf2fef5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RHI renderer: begin frame and submit even if we have no commandsPaul Lemire2020-09-181-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We still need to upload textures/buffers which might be needed later on even if we have no draw calles to perform. This fixes the following case: Frame 1: A buffer is created, no command generated -> buffer data transfer not performed but still recorded in the RHI command buffer Frame 2: buffer is reallocated (we orphan, destroy the old rhi buffer and create a new one with the new size as we cannot resize rhi buffers). This time, we have commands, so we perform data transfer but in this case, we may crash as we have since destroyed the RHI buffer from Frame 1, yet we still have in the command buffer the data transfer command for the old rhi buffer (we have no way of removing commands once they have been inserted in the command buffer). With this patch, the data transfer command would get performed at Frame 1 even if we have nothing to draw, ensuring we have no left over transfer commands when reaching Frame 2. Change-Id: I48357633f6c2ee727fb74b4fd81af86e5bad68a6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* evaluateClipAtLocalTime: prevent negative indices for keyframes lookupPaul Lemire2020-09-181-1/+1
| | | | | | | Pick-to: 5.15 Pick-to: 5.12 Change-Id: I811c1a7334674d670f42eb46195e2e0e23b690f3 Reviewed-by: Mike Krus <mike.krus@kdab.com>