aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* rhi: Handle beginFrame() failure correctly in threaded render loopLaszlo Agocs2020-02-061-6/+10
| | | | | | | | Also add some comments to improve maintainability. Task-number: QTBUG-81740 Change-Id: I4be90768f7a8506b1fb493885062b98be9f4f58a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Upgrade qsb files to version 4Laszlo Agocs2020-01-2147-0/+0
| | | | | Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Replace QVariant::type with QVariant::userTypeOlivier Goffart2020-01-171-2/+2
| | | | | | | | | | | as type is going to be deprecated. This change was done automatically with the help of clazy. In addition, ColumnRoleMetadata was changed to take an int instead of a QVariant::Type Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-091-0/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/particles/qquickitemparticle.cpp src/qmlmodels/qqmladaptormodel.cpp tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp Change-Id: Ibd8fbb91da6893a09f4ffe61ad0b95d8149bbc87
| * Fix unused variable warning on big-endianShawn Rutledge2020-01-081-0/+2
| | | | | | | | | | | | | | Fatal because of -Werror. Change-Id: I535848be1c733c0718779c8a4c8c93ed3873cc88 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Fix Qt6 build in preparation of qt5 submodule updateAlexandru Croitor2019-12-193-16/+16
| | | | | | | | | | | | | | | | | | Fixes the QTextStream usages. Change-Id: I0c009a82fb644a9f3c3d42ec410d18b680977f23 (cherry picked from commit 1c5c5f7aadc2dcc73a21eeb818e95c4e1b7de70f) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add API to get the platform specific texture handlePaul Olav Tvete2019-12-176-178/+57
| | | | | | | | | | | | | | | | | | Also update the implementation of setTextureFromNativeObject to use the new API from QRhi Task-number: QTBUG-78570 Change-Id: Ic43371c4bb7a1dd14bfe5ef0d8ce2ef50e1d25d6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-174-3/+9
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4engine.cpp src/qml/parser/qqmljs.g Change-Id: I5f89199ef7a846032a3118cba1298de992c22f8f
| * Merge remote-tracking branch 'origin/5.14.0' into 5.14Qt Forward Merge Bot2019-12-133-3/+3
| |\ | | | | | | | | | Change-Id: Ibd935bf31aa2bcb2e4051c865ab946daeeeecddb
| | * Fix NativeRendering text on core profileEirik Aavitsland2019-11-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This is a continuation of af090d8, making sure the same dpr snapping is done in the core profile shaders. Change-Id: Iccd19a377968fb7bfbd49c3ef13b72284a48bab1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * | rhi: Mark window as unused when neededLaszlo Agocs2019-12-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is a bit more convoluted, but boils down to no-opengl + no-vulkan. Task-number: QTBUG-80692 Change-Id: I508116721ae8ea5013546f20ac89b67929305b52 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | Fix unused var in no-opengl buildsLaszlo Agocs2019-12-111-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I9c436f408562faaf74e2301ae93e25a0c4e9b22e Fixes: QTBUG-80692 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Share pipeline state objects between layer renderersLaszlo Agocs2019-12-162-63/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...as long as the renderpass descriptors are compatible. Relies on the new QRhiRenderPassDescriptor::isCompatible() function. In the nodetypes_ng manual test this brings down the number of pipelines created from 16 to 8 in the layer test scene (because most layers use the same materials there, so many pipelines can be reused between them - previously this was prevented by the comparison-by-pointer for the QRhiRenderPassDescriptors). Additionally, any application with more than one layer (Item.layer enabled or ShaderEffect) in the scene will benefit from this. Task-number: QTBUG-80318 Change-Id: Id7437a3baac31891a231643d4787da7186ac107e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Add trace points for Qt Quick Scene GraphMilian Wolff2019-12-1311-3/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds Q_TRACE tracepoints for all places that are covered by the QML profiler's QSG integration. The big advantage over the existing framework is that these trace points can be visualized next to other system tracepoints to correlate the data better with load and resource consumption induced by other processes on the system. Change-Id: I0c5b70a0870f0b89e4533c351c099e13fd18a55f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Regenerate rhi shadersLaszlo Agocs2019-12-1147-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generated GLSL code for version 150 is now slightly different (we now disable the unnecessary GL_ARB_shading_language_420pack to prevent failures on older OpenGL implementations and core profile contexts). Task-number: QTBUG-80690 Change-Id: I4c6242284c1239af9f12bd2fdac3c33707ac88e7 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Clear RequestRepaint bit set in sync() if we are going to renderLaszlo Agocs2019-12-031-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...because if we are going to go on doing a frame then the repaint request is fulfilled. Leaving the bit set would cause the render thread's main loop to start another frame right after the current one is queued, which is kind of bad in certain scheduling and blocking cases because the main thread may end up starving due to the unnecessary extra (and sync-less) frame. Task-number: QTBUG-80498 Change-Id: I6c9a8f60e5f49d771d7d284bb7399eadbde33b8c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-291-0/+3
|\| | | | | | | | | | | Change-Id: Ic754916ddc223c6ce20f0298eec02a3513fc0222
| * | Warn about using QSGTexture::bind outside direct OpenGL pathJohan Klokkhammer Helsing2019-11-281-0/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-80364 Change-Id: I9281fb992bcb01d56714b491f313dd44a757d68a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Make the initialization failure dialog sensible with QRhiLaszlo Agocs2019-11-286-34/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So on Windows one now gets a message box with a reasonable message, instead of the OpenGL nonsense. Then the application closes when pressing Abort etc. On other platforms there is a qFatal, printing the same message. Involves simplifying the OpenGL version a bit since passing isES type of flags through multiple layers is not justified here. Task-number: QTBUG-80365 Change-Id: Ie3ea1e9395a283f7e95eda78c1d3894797ff0acf Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Prevent infinite rhi init failure in threaded render loopLaszlo Agocs2019-11-282-10/+37
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-80365 Change-Id: I929fb76eb8d023ab048f6d1c91be078de3cfe750 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Prevent infinite rhi init failure in basic render loopLaszlo Agocs2019-11-281-7/+27
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-80365 Change-Id: Iaa2f97b02c4665f0485226d9aa420993330d78f8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Fix Metal usage on iOSLaszlo Agocs2019-11-273-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Also enable the two Metal-specific scenegraph examples on iOS. Change-Id: I0e1e6d527544ea4a5bfb0d08ca2d32c762d3c699 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-266-3/+6
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qmldirparser/qqmldirparser.cpp src/qml/qmldirparser/qqmldirparser_p.h Change-Id: Ia68a8d4f345e6e456eebc3f215fc90d3819ddd70
| * | rhi: Follow non-integer scaling fixes for native textLaszlo Agocs2019-11-256-3/+6
| |/ | | | | | | | | | | | | | | | | Add the dpr-related modifications to the shaders used on the QRhi-based rendering path. Change-Id: Ice980a80cbf9910d06a95a957817ff3d689c5e0f Fixes: QTBUG-80297 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-257-10/+10
| | | | | | | | | | | | | | Amends 744e77b841878fb017c0f2d60607090008f28180. Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Avoid initializing QFlags with 0 or nullptrAllan Sandfeld Jensen2019-11-2212-16/+11
|/ | | | | | | | | It is being deprecated. Change-Id: I844bd92af85bc53a8fc0371408d05277bd49f511 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix: NativeRendering text for non-integer screen scalingEirik Aavitsland2019-11-186-6/+14
| | | | | | | | | | | | | | Commit 6e883c53 introduced snapping to pixel grid for non-integer device pixel ratios. But the snapping also modified the w element of the coord vector, which resulted in mangled and offset rendering. As a driveby, add the dpr snapping also to the outlinetext shader, as it improves rendering quality. Fixes: QTBUG-70481 Fixes: QTBUG-78160 Change-Id: I4c4b1788005514adc0255878ba24cdf1acc6755f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Fix documentation warningsTopi Reinio2019-11-112-3/+3
| | | | | | | | | | | | | | | | | | There were a lot of documentation warnings introduced by the separation of QtQml.Models and QtQml.WorkerScript modules from the QtQml documentation project into their own sub-projects. Fix the above, and also ensure that the experimental Qt.labs.qmlmodels QML types are listed in the documentation, and add them also on the QML module page for QtQml.Models. A few warnings remain, they may be indicative of issues not in the scope of this commit. Fixes: QTBUG-79812 Change-Id: Idc25c976e4c96feab4aae893519d6c9245f57a64 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix assertion with certain Text items when rendering with MetalLaszlo Agocs2019-10-251-2/+4
| | | | | | | | | | | | | Caused by a -1 vs. 0 discrepancy between the QRhi and the OpenGL glyph caches. width() and height() are expected to return 0 for an empty image, but this we forgot to honor in the QRhi version. That returned the width or height of a QSize, and those are -1 when default constructed. (there are good reasons for that, it just happens to not match the non-QSize-based code path here) Change-Id: Idda0d2f77430abea79d4004b765077032e06954b Fixes: QTBUG-79533 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix broken scaling with high dpi + rhi + thread loopLaszlo Agocs2019-10-211-3/+1
| | | | | | | | | | | | | | The arguments to renderSceneGraph() were incorrect in the threaded render loop, unlike basic. Fix it up to follow what we do in the basic loop. (The first argument is the QWindow size (logical). The second is only used when rendering via the rhi, and is the output surface/layer size, in pixels. This will get simplified in Qt 6.) This fixes broken rendering with Metal and the threaded render loop for windows with dpr > 1. Change-Id: I427ba5def8cc34900e6fe650e1006ca5f0fa90a4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Support DXT1/3/5 in compressed texture atlasv5.14.0-beta2Michael Brasser2019-10-172-3/+21
| | | | | Change-Id: I791adbfce96481aea71bb285e48b89cb5db08e1c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-10-102-1/+7
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: I117c8d62b21800329d1035021d312d9924f83a1b
| * Fix sprites leaking textures in SW and OpenVG backendsEirik Aavitsland2019-10-072-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QSGSpriteNode is initialized with a texture, it is supposed to take ownership of the texture and delete it when the node gets deleted. In the default backend, this happens automatically: The texture gets assigned to the node's QSGMaterial object, and the node has set the OwnsMaterial flag, and so the inherited QSGGeometry destructor takes care of deleting the material, which deletes the texture. However, the Software and OpenVG backends do not have material objects, so the above mechanism does not apply, and so the texture objects are leaked. Fix by deleting the texture object directly from the SoftwareSpriteNode and OpenVGSpriteNode destructors. Fixes: QTBUG-77019 Change-Id: I503d704f66593ba6a36c969db80f74f715382b6b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Handle context loss in the basic render loopDavid Edmundson2019-10-081-0/+18
| | | | | | | | | | | | | | | | | | | | | | In the event of a graphics context loss, we need to reset the scenegraph and the GL context. As all windows share a graphics context a loss detected in one window needs to reset the scenegraph on all windows. Change-Id: I3ff1a93d5a08fa21366a6a56e94bd2185aebb2d5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Revert "Temporarily drop a debug mode check in rhi-based stenciling"Laszlo Agocs2019-10-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | The qt5 submodule update is now done in qtbase, so the code here can now be migrated to follow the QRhi (private) API changes. This reverts commit 7661b142a130df54af3a5430a29e3c82da086c7b. Task-number: QTBUG-78995 Change-Id: I6995cd5e14b75622a51c9e95fb3178485d67d63d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Follow QRhi improvements and drop QVectors where applicableLaszlo Agocs2019-10-076-12/+16
| | | | | | | | | | | | Task-number: QTBUG-78883 Change-Id: Ifcf5af843b5101a35ecc762a6a3b0196b6d97782 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Temporarily drop a debug mode check in rhi-based stencilingLaszlo Agocs2019-10-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | ...to avoid blocking the next submodule update. Can be restored afterwards. There is no temporary compatibility function for the QVector-based getters in qtbase. This got overlooked probably because it is in a block that is there in debug builds only. Change-Id: I3de3f48934e6a31cc14a90f306fddfa04ac56f41 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Drop QVector for srb and shader stage descriptionsLaszlo Agocs2019-10-032-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the QRhi changes that move away from QVector in QRhiShaderResourceBindings and QRhiGraphicsPipeline. This, together with QRhi's de-d-pointering of QRhiShaderResourceBinding, is bringing significant performance improvements for scenes with a lot (thousands) of unbatched items, since a large number of allocations are now avoided due to not having to create a QVector of d-pointered classes just to do a lookup in the srb cache. Change-Id: I612ab2d9449a9e0ce79f7169b942b95d55af61ff Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Fix device pixel ratio with QRhi for native textLaszlo Agocs2019-10-035-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculating values based on the dpr is not possible in the sync phase, because the strictly correct dpr (that takes redirections into textures into account) is not known until QQuickWindowPrivate::renderSceneGraph(). The text material implementation attempts to dig out something directly from the context's associated surface, but this does not match the way QQuickWindow calculates the value (although it would work without causing any trouble in many cases). This is of course incompatible with the QRhi-based abstraction since neither the context nor the associated window (if there is one even) is known to materials. To solve this, create a proper solution that makes the QQuickWindow-calculated dpr available already in the sync phase (so in updatePaintNode() implementations): have QQuickWindow calculate calculate the dpr in syncSceneGraph(), and pass it down via the rendercontext. Only the rhi-based code path is touched in this patch. The direct OpenGL path could be fixed in a similar manner (by migrating to rc->devicePixelRatio() in the sync phase and state.devicePixelRatio() in the render phase), but that is left as a future exercise. Task-number: QTBUG-78610 Change-Id: Id9d9d4b1fd5b9730a64834fbbf61c74af4a8ed07 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | QQuickWindow: Don't leak the animation controllerUlf Hermann2019-10-025-7/+9
| | | | | | | | | | | | | | | | | | There are ways to close the window without hitting the code paths in the render loops that delete the animation controller. Probably if no frame was ever rendered. Change-Id: If3e9d2051525c4ff50eda19084c967578fe4f4b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove depth-stencil buffer sizing on the rhi pathLaszlo Agocs2019-09-302-11/+11
| | | | | | | | | | | | | | | | | | ...as this will be done automatically by QRhiSwapChain after the corresponding QtGui changes. Task-number: QTBUG-78641 Change-Id: I8edeb728f3aba07bfa6bc6331966fba4bdee71f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Add a QSG env var for QRhi::PreferSoftwareRendererLaszlo Agocs2019-09-272-5/+14
| | | | | | | | | | | | | | | | | | Also extend the docs. And while we are at it get rid of some clang warnings. Task-number: QTBUG-78669 Change-Id: I4ef15d2d066098ba7bbbd34e80d4e61efe7fba23 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Add missing QSGDynamicTexture default constructorFlorian Bruhin2019-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | In 341ab7708049b1a3f559b76f16393e688951a938, an internal QSGDynamicTexture::QSGDynamicTexture(QSGTexturePrivate &dd) constructor was added, which means QSGDynamicTexture now doesn't have a (formerly implicit) default constructor anymore. Fixes: QTBUG-78312 Change-Id: I34a918942d87ca522aa7131580b9e08a1445d635 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Change const ref to ref in QSGMaterialRhiShader as per API reviewLaszlo Agocs2019-09-2314-85/+88
| | | | | | | | | | | | Change-Id: I7783ed26a66f03ebe3b26bcba2f42f9fff45a417 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Add an env var to periodically kill the device on d3dLaszlo Agocs2019-09-232-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...in order to test the handling of losing the device. The D3D11 backend of QRhi provides a convenient way to test this. Hook it up to a QSG_RHI_SIMULATE_DEVICE_LOSS environment variable. The value is the number of frames to wait before breaking the ID3D11Device. We cannot currently recover from a device loss. Hence the importance of being able to test in a simple way. The rhi code path needs to be brought up to the level of the direct OpenGL path in this respect, in separate patches. Change-Id: I66d6315dc60a9673903da9bed36de0cdd115f4a7 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Recover from device lost on the rhi path in the threaded loopLaszlo Agocs2019-09-231-61/+100
| | | | | | | | | | Change-Id: I90d43d5daa75bbc52c9c10f4ef920b898bbd39d4 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Handle rhi device loss in the basic render loopLaszlo Agocs2019-09-231-5/+40
| | | | | | | | | | Change-Id: I02cee05ce7eee2ad1c458d1a934c210c12d1dea2 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Add missing doc entries for QSGGeometry::Type valuesLaszlo Agocs2019-09-181-0/+4
| | | | | | | | | | Change-Id: Iaef8dfa6a984eb709aaae35a94641c3e0183254e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add some missing since and internal doc tagsLaszlo Agocs2019-09-182-14/+23
| | | | | | | | | | Change-Id: I50c6a5c7a55cfc481ff572113c58951983671cdc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Avoid changing function signature in public headerLaszlo Agocs2019-09-184-7/+58
| | | | | | | | | | Change-Id: I0be124dfcafa2244531281ffd1ac6b559d82c604 Reviewed-by: Lars Knoll <lars.knoll@qt.io>