summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Rename more test targets conflicting with qtbase onesKai Koehne2020-11-2420-18/+201
| | | | | | | | | Fixes: QTBUG-88790 Change-Id: I886592001ed2d8aad8ab6df542ea788b44d2ff71 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e4cd93bcad4953e95f5bc6f3d35502a604f2ec97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle fallout from QEvent loosing it's copy constructorMike Krus2020-11-232-572/+650
| | | | | | | | Task-number: QTBUG-88757 Change-Id: I5097faecd2e895d4685a4cc57a4e2a5c079f2255 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit d826238b65b0ebd8034900224b382bd85e6add27) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Introduce QGeometryRenderer::sortIndexMike Krus2020-11-202-0/+24
| | | | | | | | | | | Lets user override the sorting order of entities. [ChangeLog] Add sortIndex property to QGeometryRenderer to explicitly control the order in which entities are rendered Pick-to: 5.15 Change-Id: Iab7fd0d705f7ddcb424a59f86f8c2c28059813d1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix deprecated API usage and compile warningsMike Krus2020-11-2014-157/+154
| | | | | | | | | - 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-203-0/+7
| | | | | | | | | 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>
* Fix GLTexture cleanupPaul Lemire2020-11-045-1/+163
| | | | | | | | | | 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>
* Handle invalid entity names in QSceneLoader::componentMichael Brasser2020-11-021-0/+7
| | | | | | | | Return nullptr rather than crashing. Pick-to: 5.15 Change-Id: Ie11fe798e0bcd3bfdfda053331eabf9ed16e3d94 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix resource path for 3dcore testPaul Lemire2020-10-291-1/+1
| | | | | | | Windows doesn't like colons in a path. Change-Id: Ia5e8da4e45bf8e99600eb8ab0bcd610fa5e2ad64 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add caching mechanism to ShaderBuilderPaul Lemire2020-10-281-2/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-273-3/+3
| | | | | Change-Id: Ic12bc80a00e887a959c6cb27e72be0422d71b254 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Pass the raw data to the texture data extractorJuan José Casafranca2020-10-271-23/+1
| | | | | | Change-Id: If6ca151b22f442985df1ff34108ca0bd216ebf47 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 6fdf835639e56c68ae01da894c7d2b9f552dd87d)
* Expand QPaintedTextureImage documentationMichael Brasser2020-10-221-0/+2
| | | | | | | | 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>
* Rename test targets conflicting with qtbase onesKai Koehne2020-10-082-1/+23
| | | | | | Task-number: QTBUG-87217 Change-Id: I2c6f2e0af475d03baa74799a61d70c603fd2ce85 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use internal CMake APIMike Krus2020-10-07337-517/+517
| | | | | | Task-number: QTBUG-86815 Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make DebugOverlay accessible from QMLMichael Brasser2020-10-021-0/+2
| | | | | | | | Register and document QDebugOverlay. Change-Id: I357918ce3448c451d796f88656ec287bf03ffcfd Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix a crash when node is added and destroyed immediatelySean Harmer2020-10-011-0/+47
| | | | | | | | | | | | | | 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>
* Allow to specify a functor to extract data from QTextureImageDataJuan Casafranca2020-09-281-0/+11
| | | | | Change-Id: Idd052f6c24665a1accd2cd681c80fe74846e5c39 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Allow to set alignment requirement for an imageJuan Casafranca2020-09-281-0/+1
| | | | | Change-Id: Ifffbfd80a3d99b43e348e12bea62e3c90eed80c4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix animation not runningMike Krus2020-09-253-8/+9
| | | | | | | | 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>
* Add QNodePrivate::registerDestructionHelper for std::vector containersPaul Lemire2020-09-231-9/+191
| | | | | | | | | 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>
* Remove deprecated API from custom-mesh manual testsPaul Lemire2020-09-182-4/+0
| | | | | Change-Id: Ie7272b6d18b0da535b657041bbde81b1e4e6334a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderGenerator: add a #define LAYER_name for each layerPaul Lemire2020-09-181-0/+36
| | | | | | | | | This will make it more convenient to insert conditional code based on whether a layer is defined or not. Change-Id: Ia72b569f022dd2ee723bf2493710eab709042639 Pick-to: 5.15 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix build with latest QtBase and QtDeclarativeMike Krus2020-09-072-4/+4
| | | | | | Task-number: QTBUG-86410 Change-Id: I26427d65de72c86f952b076259979f90eaef87f4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QCoreSettings classMike Krus2020-08-273-4/+4
| | | | | | | | Adds the ability to disable bounding volume updates from the core aspect. Change-Id: I6d8a4c6f8fd880c9fca015cd40eaf7316747a2c6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix connect in rendercapture-qml manual testsPaul Lemire2020-08-262-2/+3
| | | | | Change-Id: I33afeae789f774d07de157d59c96c9e878f5c0bc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* scene3d-loader: use QtQuick.Controls 2Paul Lemire2020-08-261-2/+3
| | | | | Change-Id: Ib625369054f1a185f28f45ac7ed9c4faef34b4f5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Move sync jobs to a common place so that they can be used by rhi and openglPaul Lemire2020-08-261-1/+2
| | | | | | | | | This reduces duplication and will make it easier in the long run to maintain both backends since what these jobs are doing are doesn't really on the rendering backend in use. Change-Id: I9e51f964880874de52a2fa55c7753a1a5633d023 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix compile warningsPaul Lemire2020-08-188-13/+13
| | | | | Change-Id: I4fbded297c1988b3ace17f6675527a0a00db8973 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Remove useless virtual methodMike Krus2020-08-131-2/+0
| | | | | | | | It's only used internally anyway. Also fix couple warnings. Change-Id: Ibe44fbcede0676b3822c5003ed447430ae93d2dc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QRenderTargetSelector: remove outputs/drawBuffers propertyPaul Lemire2020-08-131-30/+0
| | | | | | | | | | This cannot be handled with RHI and in practice nobody ever used that feature. [ChangeLog] QRenderTargetSelector remove outputs/drawBuffers property Change-Id: I6b02718733e5c05cee9074b0078ba2a544de95d6 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix missing override warningPaul Lemire2020-08-137-12/+12
| | | | | Change-Id: I568ba2d39179f9b5b35190cf86c316788f903d6c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: Rework the way we handle RenderTargetsPaul Lemire2020-08-131-20/+55
| | | | | | | | | | | | | | | | | | | | | | Instead of creating a RenderTarget when we create a pipeline, we now create RenderTargets any time a frontend defines one. This allows to align with the other type of resources that we create before pipelines. Add a dirty flag on QRenderTarget so that backend can easily check if a frontend RenderTarget has changed. Also remove the handling of QRenderTargetSelector::outputs which allows to specify a subset of draw buffers for a given FBO. This cannot be handled with RHI and in a more general way, removing that altogether might simplify the API. If you share the attachments, nothing stops you from creating several FBO to handle that case. Fix coding style and update the unit tests. Change-Id: I9f3623e9d7ab9d508db207f2c43cc6c1eedb4f01 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Complete UBO/SSBO supportPaul Lemire2020-08-0511-43/+413
| | | | | | | | | | | | | | | | | | | | | Up until now, we would expect Parameters to be a single value mapping to one of the UBO's member This patch adds handling for the following cases: - A parameter can now reference a UBO Buffer This allows filling all the members of a UBO block at once Note: Since we internally create a single UBO for all commands sharing the same pipeline, we will copy the content of the user provided UBO at the proper position inside the larger single UBO. - A parameter can now reference a ShaderData This allows to fill a struct member of a UBO block - SSBOs are now handled when creating the ShaderResourceBindinds We don't do any magic with these, a RHI SSBO maps to a Qt3D Buffer Change-Id: I68f9e527a0b0137f460cb3a99c469318f2ee5d98 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderGenerator: generate node headers in the same order as statementsNicolas Guichard2020-07-313-84/+83
| | | | | | | | | | | | | | | This ensures that header snippets that depend on one another are forced to be emitted in the correct order, assuming the nodes also depend on one another. This has the side effect of dropping header snippets from nodes which are not connected to any output node or with any unbound input. Also removed a few lines of unused code. Pick-to: 5.15 Change-Id: I5e544470aea1d34467f8165fb49e48d38931e0bc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make sample meshes geometry renderers againMike Krus2020-07-3096-556/+351
| | | | | | | Introduce new geometry view class for each. Change-Id: I8e9a8f3a078d4cc63f9656ae8142e39f05d755c7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for synchronous pickingMike Krus2020-07-303-2/+21
| | | | | | | | World space and screen space raycasters gain method to do a pick query synchronously, returning the list of hits. Change-Id: I41cc3940b8d97c3619456d76127841907a9170cb Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Refactor Scene3D to work with both RHI and GL Qt3D renderersPaul Lemire2020-07-292-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Depending on whether we are using RHI or GL we need to either trigger the rendering after the beforeRendering or beforeRenderPassRecording have been fired -> beforeRendering The RHI command buffer is set up but nothing has been recorded yet. This is what we want for the RHI backend but we will need to make sure we don't call begin/endFrame nor use swap chains other than the one QtQuick is using. This means RenderSurfaceSelector won't be possible. -> beforeRenderPassRecording The RHI command for buffer uploads have been uploaded but the actual RenderPass draw calls have yet to be made. The screen has been cleared already, so this is the best place for the GL backend which expects the screen to have been cleared. - The GL backend can use a QOpenGLFrameBufferObject but that is not possible with the RHI backend. - The RHI backend uses a custom QRhiRenderTarget that takes care of blitting its color attachment into a QRhiTexture which is then bound to a QSGTexture The overall Scene3DItem/Scene3DRender architecture remains the same: - processChange - Render Qt3D content into Texture - Set texture on a custom QSGNode quad Change-Id: Id6c317342d0a227d5295cbfefefc3ed12da160d7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix build to change in typeof QList::size()Mike Krus2020-07-171-1/+1
| | | | | Change-Id: Ib480a8eef157102df8f89a75983cd4d8d46a9388 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* rhi: fix SubmissionContext::loadShader for Unicode filesNicolas Guichard2020-07-161-0/+8
| | | | | | | | | | | | QRegularExpression::match takes a QString and not a QByteArray, so QRegularExpressionMatch::capturedStart is not reliable to locate bytes in a QByteArray which might contain Unicode data. This fixes the issue by explicitly working on QStrings. Pick-to: 5.15 Change-Id: Ia32ee169718d98e7197d7bfa19ca23e6e243dc25 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* PipelineKey: use Geometry Layout instead of GeometryIDPaul Lemire2020-07-165-1/+147
| | | | | | | | | | - Allows to create less pipelines - PipelineUBO: use aligned offsets - RenderCommand store ShaderResourceBindings (avoids creatings a new one every frame) and store last used bindings to see if rebuild is required. Change-Id: I3a44d340a92f5c48f150896b9aa9912527b3b1ea Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add AttributeInfo to allow comparing RenderCommand geometry layoutsPaul Lemire2020-07-1611-0/+865
| | | | | | | Also start adding tests Change-Id: Ia9d7fb9beaf8623c47bfafd6f5f0751c6571f82f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVector in testsJarek Kobus2020-07-0986-832/+709
| | | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I48e643bd20e21bee031555af598ad95d9873de12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move RenderViewInitializer,Builder/Updater jobs to a common placePaul Lemire2020-07-081-1/+1
| | | | | | | | | All the renderer plugins are doing differently really is the submission part and the way commands are built which we can hide entirely in the RenderView/RenderCommands Change-Id: If4d6a472f1ce1b36ffa5b4ca75e3420e42a165f5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVector in animationutils testJarek Kobus2020-07-081-445/+397
| | | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I378397aaeb7151b8a083ea62155dc4a38ec302a8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QList instead of QVectorJarek Kobus2020-07-079-18/+18
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic726ce85e01190dbc64426388fd454c54ae3c3e3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move and adapt RendererCache to share amongst renderer pluginsPaul Lemire2020-07-071-4/+4
| | | | | Change-Id: I4e6e48abdd79b59fe98a916c7f2da6ba92e8ff82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GLTexture: change internals to use std::vectorPaul Lemire2020-07-071-4/+4
| | | | | Change-Id: If680702aed4544395866a7b376db920561bf16cc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Refactor RenderQueue so that it can be shared between renderersPaul Lemire2020-07-072-10/+10
| | | | | | | It is now template based, header only Change-Id: I130ad84adce0638329f9d9fd7cfbf1608a7627f4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Share code between renderer pluginsPaul Lemire2020-07-076-78/+79
| | | | | | | | | | - MaterialParameterGatherer is common to both - FilterCompatibleTechniqueJob is common to both - RenderViewJobUtils refactor to only contain code common to both - UniformBlockValueBuilder moved to dedicated file, shared with both Change-Id: I634e6d60eb9a213dd6a0d5abd8ac53710bff1417 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* RenderQueue: switch to std::vectorPaul Lemire2020-07-033-4/+3
| | | | | Change-Id: I49ab3985ee01e40950bcd981dc77139a28f8db6a Reviewed-by: Mike Krus <mike.krus@kdab.com>