summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* PickBoundingVolumeJob/RayCastingJob: switch to std::vectorPaul Lemire2020-07-032-23/+23
| | | | | Change-Id: Iad29450706dacef966e749ff964172a19d54dcfb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* GraphicsHelpers/GLShader: switch to std::vectorPaul Lemire2020-07-039-52/+52
| | | | | Change-Id: I8be6695e0c52dfbe353cd381d94548aba1c7da82 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* APIShaderManager: switch to std::vectorPaul Lemire2020-07-031-12/+16
| | | | | Change-Id: Ied22ef9dea4cd3043f9f3d5ec69d7628e60b7dd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-0213-100/+108
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Disable test on the macMike Krus2020-07-011-0/+3
| | | | | | Task-number: QTBUG-85071 Change-Id: I6ac655d42961186f1ec0737d3cdd14bde553b688 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* Input Aspect: Dispatch events directlyMike Krus2020-07-011-72/+77
| | | | | | | | | | | | | Rather than accumulating events during a frame, they are now directly delivered to the device handlers synchronously. This removes the need to use jobs for updating the nodes. Updating axis and logical devices remains done using jobs at every frame. Change-Id: I2853a72cfe68201d8a6eb44d37bc64c9f50efd4f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix clip-planes-qml manual testPaul Lemire2020-07-016-31/+384
| | | | | | | | - Add shaders that were removed - Use qrc: prefix on mesh source Change-Id: I2293a17572f7a5ff323beece0a860b7762265dbc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Renderer: move QVector to std::vector changesPaul Lemire2020-07-012-2/+2
| | | | | Change-Id: I99a55a52da55b9b8c32e0db8e47932a4eb2820fa Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Render aspect: Dispatch events directlyMike Krus2020-06-302-149/+117
| | | | | | | | | | | | Events now delivered directly to the input aspect which dispatches them appropriately. The picking job still accumulates events within a frame. However, this opens the door to synchronous picking and event propagation control later on. Change-Id: Ic525bdce4e3d30455558fce9e385331364e49026 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Switch to std::vector in QRenderAspect backend and OpenGL rendererPaul Lemire2020-06-304-16/+22
| | | | | Change-Id: I91dd69fc205401b12f333a9a0534d9612c8e24f8 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix incorrect use of QString vs QByteArrayMike Krus2020-06-292-6/+8
| | | | | | Change-Id: I206fc781de5e4f281c9850c7d9f89c2ef3e588a0 Pick-to: 5.15 Reviewed-by: Liang Qi <liang.qi@qt.io>
* rhi: fix rendertarget manual test invalid build filesJean-Michaƫl Celerier2020-06-253-32/+18
| | | | | Change-Id: I7f2ea8e4e474daaeff132427ff90089984b2d471 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix manual-renderloop testPaul Lemire2020-06-251-1/+1
| | | | | | | | Set the QRenderAspect to the manual SubmissionType to avoid the application rendering atuomatically and eventually deadlocking Change-Id: Idd38948af5c2ebd792b61c5ce5177138469295a0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add missing tests and benchmarksMike Krus2020-06-24114-1546/+401
| | | | | | | | | Many got missed by script it seems. Cleaned all those in render to use the shared cmake config script. Also added benchmark build, in release only (not tried to run them). Change-Id: I63bbdddedd50a51ea5ac585419527b461380d9cc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-2412-29/+29
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I2e126d0be8efa0aa89c4a91a681b549f38c8cec4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>