aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Warn when requesting GL/Vulkan but Qt is not configured for thoseLaszlo Agocs2021-03-261-0/+5
| | | | | | | | | | | | On embedded and mobile it can happen that the Qt build has no Vulkan support (because it is not there or not detected in the sysroot), and while this is visible in the configure output, it is best to make it also clear at run time. Change-Id: I316671a04aba80d38d2f8514695f55b05fb94dbd Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4b83ae6472b30626c3492442a91125830ce28ebe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call commitTextureOperations for small atlas texturesRoman Genkhel2021-03-231-1/+3
| | | | | | | | | | | | Atlas textures with size not greater than QSG_ATLAS_TRANSIENT_IMAGE_THRESHOLD are not visible Fixes: QTBUG-91182 Change-Id: I4e72e1c32c15b9e1a21cdb07262f219cc641bb5f Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit a7b32a3e893892fc96d58af110af568043f09e72) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clean up QSGRhiSupport wrt static functionsLaszlo Agocs2021-03-202-22/+18
| | | | | | | | | | | Make static everything that can be static. At the same time, make configure() non-static. Does not change behavior in any way, but this is the more logical approach. Also more future proof. Change-Id: I601d59a0547106802f330a7551a97186cde481e0 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit fb8ba3f7250f837dd29600d30108ba6f4470a727) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't invalidate unaffected render ordersEskil Abrahamsen Blomfeldt2021-02-252-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | If you have a list of render orders A, B, C, then A and C changes, we also invalidated B. This was to avoid the situation where B was ignored by the batching algorithm and A and C would end up being batched together. This has a performance impact for some scenes though, where you might have top level and bottom level items that constantly change, causing all geometry in the scene to be uploaded every frame. Instead of doing this, we skip invalidation of B, but include its bounding rect when checking for overlaps, so that we still avoid batching A and C together but without the need to re-upload B. Fixes: QTBUG-90632 Change-Id: I462cf1938360643ca9fa1425ae8c8e08b534fd76 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com> (cherry picked from commit 9aa3db2e19b2e1622b878cf34b1978f4fdbcac39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove Windows 7 VM workaround from rhi initLaszlo Agocs2021-02-191-11/+1
| | | | | | | | | There is no longer a Windows 7 configuration in CI. Change-Id: Ic190735301f03e84974132ed1183adfd9352187a Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4d9d5ab8187a2e1391afdcd0716bd43196040984) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve QSGMaterial docsLaszlo Agocs2021-02-191-15/+31
| | | | | | | | | | | | | | Remove a Qt 6.0 editing issue where the docs continue saying "QSGMaterialShader and QSGMaterialShader", which is a leftover from 5.14/5.15 times when QSGRhiMaterialShader still existed. While we are at it, improve the code snippets and talk a bit more about type(), inspired by recent mailing list discussions. Change-Id: I4b21ed00285bf18e22e64a7574a273abdf8be3e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 258077e00eb8f3f4b0ef21a9a0395268b6c86532) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSGBatchRender: avoid crash if buffer shrinksFabian Kosmale2021-02-081-2/+2
| | | | | | | | | | | | | The QRhiBuffer does not shrink; thus we can end up with buffer->buf->size > buffer->size. This would subsequently lead to an out-of-bounds memory access, and a crash. Fix this by using the uploadStaticBuffer overload which takes the size. As a drive-by, remove pointless QByteArray::fromRawData call. Change-Id: I40058ada6a6a5eb745ae559e8c9ed474fd41f75c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit f0a51eef5696782ec325b20f14cfe353d0a58d20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Invalidate external renderpass descriptors from Quick3DLaszlo Agocs2021-02-053-0/+19
| | | | | | | Change-Id: I362b35b3d038d4fb24fab0e73cb120027f2308ea Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 93fe74ca433850e505f8f8940e99f3bf6a6dc050) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation after subpixel handling changes in qtbaseFabian Kosmale2021-01-274-5/+6
| | | | | | | Change-Id: Ife394e660274dd9dbe17207e18c5024f90628a00 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add env.vars. to toggle pipeline cache load/saveLaszlo Agocs2021-01-254-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRhi has APIs (but private ones) that allow retrieving and restoring the contents of the "pipeline cache". (which may map directly to VkPipelineCache, or may be a simulated, OpenGL program binary based solution) In many cases it is convenient if the saving of the cache blob to a file, and then, during subsequent runs of the application, the loading of cache contents, can be enabled via environment variables: QSG_RHI_PIPELINE_CACHE_SAVE=filename maps to setting the EnablePipelineCacheDataSave flag on the QRhi, and writing the collected data to file upon application exit. (more correctly, when the QRhi is about to be destroyed by the render loop) QSG_RHI_PIPELINE_CACHE_LOAD=filename maps to attempting to read the contents of the specified file, and, if successful, passing it to QRhi right after initialization. When supported and the data is not corrupt or incomplete, the result is likely improved pipeline creation times (the exact details depend on the driver with Vulkan, while with OpenGL it all maps to glProgramBinary instead of compiling from source) Setting QSG_INFO=1 can be useful to see what is happening when the above 2 env.vars. are set. With OpenGL the simulated "pipeline cache" is orthogonal to the Qt 5 era shader program disk cache: loading from both is supported transparently to the application. When QSG_RHI_PIPELINE_CACHE_SAVE is enabled, the disk cache will not be written to. Task-number: QTBUG-90398 Change-Id: I82d9a81e9dab39d3513a6aa7c6e1ff748a4ec6e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Query QRhi's desired Vulkan instance extensions instead of hardcodingLaszlo Agocs2021-01-211-2/+1
| | | | | Change-Id: I9859e1b2f786f1e578f3536bb3299c38a3a9a8b6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-153-224/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix broken compressed texturesJonas Karlsson2021-01-141-0/+2
| | | | | Change-Id: I1c81f1190386a9f7260a6e64862946f648cb6981 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable importing OpenGL textures for the GL_TEXTURE_EXTERNAL_OES targetLaszlo Agocs2021-01-144-9/+59
| | | | | | | | | Introduce a QSGOpenGLTexture::fromNativeExternalOES() function which internally passes in the flag QRhiTexture::ExternalOES when creating the wrapping QRhiTexture. Change-Id: I919e2539304d3aeaa6bc8e5953d96adc810abb12 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix accidentally removed initialization of m_sizeJonas Karlsson2021-01-081-1/+2
| | | | | | | Removed in dfb36c91b401308f74a5bc635f9a77ba2f9872a0 Change-Id: I56bd239f068e51950cbe8b5d3df6fea92156d7fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use new QTextureFileData::getDataView methodJonas Karlsson2021-01-074-22/+16
| | | | | Change-Id: Ib675bfaa3fd818ef3e372bc2affd87e0d9d8f480 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make software backend fallback automatic with vnc and similarLaszlo Agocs2021-01-051-0/+12
| | | | | | Change-Id: I3ce4494e9dddc9bf933793b354dc43494b3c84ef Fixes: QTBUG-89561 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use the new, dedicated D3D surface type for QQuickWindowLaszlo Agocs2021-01-051-1/+1
| | | | | | | | | | This way any potential logic in the platform plugin that branches based on the surface type can now distinguish between OpenGL and D3D based windows. Fixes: QTBUG-89715 Change-Id: I01e9f8a525280982a9d4a18defb970e8a2fcc362 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-163-5/+5
| | | | | | | | | | | | | 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 QtDeclarative. As the two are synonymous, this patch should have no impact on users. Task-number: QTBUG-86829 Change-Id: I5bb418483a3b06619abb4ff62cf0290a7b3bcd4f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSGTexture: fix unused warningFabian Kosmale2020-12-071-0/+3
| | | | | | | | If the opengl feature is disabled, t is not used. This caused build failures due to -Werror=unused-parameter Change-Id: Ic39703dfb540d15295811484ad3793b639dc6b9c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Avoid unused parameter in QSGRhiSupport in certain configsLaszlo Agocs2020-12-071-0/+4
| | | | | | | Pick-to: 6.0 Fixes: QTBUG-88604 Change-Id: Id84faf648656993777f780e147917151ce05d3e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use a single code path to load a QShader in QSGRhiShaderEffectNodeLaszlo Agocs2020-11-231-13/+4
| | | | | | Pick-to: 6.0 Change-Id: I8fec25df83768883896d195c09489aeb23abdafd Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove unused 'blob' member in ShaderEffect internalsLaszlo Agocs2020-11-231-1/+0
| | | | | | Pick-to: 6.0 Change-Id: I804f019f40dddce43646bf1cf91da26d4c3a4b5c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Fix potentially missing endFrame() in threaded render loopLaszlo Agocs2020-11-171-0/+5
| | | | | | | | | | | | | | | | | Upon a QWindow destroy() and show() we can get to syncAndRenderer with sync not requested. It will be followed by a full sync+render request afterwards, but first we need to gracefully survive that somewhat obscure initial round (obscure because the window is fully usable, so we get a swapchain, but then we do not sync, so there is no QSGRenderer created) Exhibited by tst_qquickwindow::headless. It correctly showed a warning on all platforms and rhi backends, but was only fatal on macOS and Metal for some reason. Fixes: QTBUG-88513 Change-Id: I0396b648af0fd2bef2964b79a28359a7f806530d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Silence unused warning in QSGRhiSupport in uncommon build configsLaszlo Agocs2020-11-091-4/+8
| | | | | | Fixes: QTBUG-88235 Change-Id: I47c20f46c77630c47a8bda7dfe6b080eafa8f4d7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-052-5/+12
| | | | | | | | | | | - Remove links to modules and examples that are not part of Qt 6. - Remove links to entities marked as \internal - Add missing enum value and QML property docs where it's trivial to do so. Task-number: QTBUG-88156 Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-10-314-18/+18
| | | | | | | Since we depend on C++17 now, all of these can go. Change-Id: I0484fd4bb99e4367ec211c29146c316453729959 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Do grabs out of orderLaszlo Agocs2020-10-192-77/+79
| | | | | | | | | | | | | ...while extending the autotest to cover more complicated cases, such as grabbing again after show-hide and doing show-grab-hide-grab-show-grab. In fact some of these cases have not been working in Qt 5. Now the basic render loop is fixed up to support the all the combinations threaded does. Task-number: QTBUG-87399 Change-Id: Id01995bc3a2660b16cfb2f8bedc84becea0be1bb Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Promote suffixless names in GraphicsApiLaszlo Agocs2020-10-162-12/+21
| | | | | | | From API review. Change-Id: I3cda6f4b4e5a2e33356e7af4f7720e0b019b546d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Have a depth buffer when doing the heavy offscreen readbackLaszlo Agocs2020-10-161-1/+8
| | | | | | | | | | | | | | The opaque pass will rely on it (by default at least). Not having a depth buffer will almost certainly lead to rendering errors, albeit silently since technically it's not an error not to have one. Just make sure there is one. The assumption is that the Z order problem mentioned in the comments in the referenced bug is caused by this. Task-number: QTBUG-87399 Change-Id: Ifbf5564848f17e7ce3498190d663c1ec693e86c9 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* doc: Group QSGTexture native interfacesTor Arne Vestbø2020-10-151-2/+13
| | | | | Change-Id: I1b305bf1b74e7e7a078d7bd4b1358d773f5d2580 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* doc: Don't overwrite native interface docsTor Arne Vestbø2020-10-151-16/+0
| | | | | | | | It doesn't look like qdoc can document the Quick specific namespace docs. Change-Id: Ic3eca2d0834c0a461f696762070e9f099e3e2641 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Declare native interfaces using helpersTor Arne Vestbø2020-10-153-36/+12
| | | | | Change-Id: I24c792fea1c5317466a155dcb3b050fac0f765b6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* doc: Update native interface accessor wordingTor Arne Vestbø2020-10-151-2/+2
| | | | | Change-Id: I1c6e9a6f949fa44265f05ce3d461d151d7e3763f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add setFlags to QSGMaterialShader for symmetryLaszlo Agocs2020-10-142-0/+10
| | | | | | | From API review. Change-Id: Ib1b3280b83222bb1b370640c4f733554f60d8104 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Adapt to platform API renameTor Arne Vestbø2020-10-095-46/+46
| | | | | Change-Id: I1f2171e18ec3df71f7eaec1be0e0e0d1442a3860 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Follow rhi per-frame to per-pass flag changeLaszlo Agocs2020-10-053-7/+10
| | | | | Change-Id: I728cecd85807eb835703a0bb8bb4acdb1f2068ae Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make sure beforeFrameBegin-afterFrameEnd always come in pairsLaszlo Agocs2020-10-021-1/+4
| | | | | | | | | | | | | | | With some platforms there is no valid window size yet when the render thread hits syncAndRender (of course, it does not actually render then). In this case we emitted an afterFrameEnd without a corresponding beforeFrameBegin. Just make sure both signal emissions are under the same condition. This is tested by the frameSignals case in tst_qquickwindow but since that's not exercised with the threaded render loop by the CI atm, the fail was not noticed. Change-Id: I300ffcc117daa4c6163ce15dd60ceffba659bd69 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Port from devicePixelRatioF() to devicePixelRatio()Morten Johan Sørvig2020-09-285-9/+9
| | | | | | | This ports all of QtDeclarative. Change-Id: Ie6eb4d96b4d49fbed1e8be514d03e331549cd712 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Map swap interval 0 to NoVSync with all the APIsLaszlo Agocs2020-09-232-2/+16
| | | | | | | | | What exactly this will cause is another question. But at least now the traditional OpenGL way of setting the QSurfaceFormat's swapInterval 0 will have an effect with the other APIs as well. Change-Id: I6d50952502a70e84828ed87347e2a948299f6f42 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Match new qHash() signatureEskil Abrahamsen Blomfeldt2020-09-175-7/+7
| | | | | | | | As documented in Qt 6 porting guide, qHash() should now also accept a size_t as seed in addition to returning it. Change-Id: I2b3ea26f631203468c071fa6ff65f95d82566132 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-161-1/+1
| | | | | | | | | | Replace more QLibaryInfo::location with QLibraryInfo::path Replace old event accessors APIs, including relevant comments. Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Output the thread and window in the render loop timing printsLaszlo Agocs2020-09-093-24/+55
| | | | | | | | Also fixes a plain bug in the basic render loop: using static to measure elapsed time is broken in a multi-window setup. Change-Id: Ie81fd9f4ec274f8ef095a8be7f280173f143de04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* threaded renderloop: Remove unused variableUlf Hermann2020-09-081-1/+0
| | | | | Change-Id: Ib68ddb664cee1ef1530d8d0bfb59e8d97a7d2f27 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* threaded renderloop: Do not abort with sleep when no changes after syncLaszlo Agocs2020-09-071-17/+10
| | | | | | Task-number: QTBUG-86089 Change-Id: If1b3369d49b5088b78f683d7512b156af3765bce Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Render loops: ignore update reqs during the main polish stepLaszlo Agocs2020-09-073-0/+20
| | | | | | | | | | | | The classic example is Shape, which needs to dirty the QQuickItem in updatePolish() in order to get it picked up in the synchronize step. That part is fine, but we do not want maybeUpdate() to issue a requestUpdate() then since we are effectively in progress of doing an update, so having another full round of polish/sync/render is a waste. Task-number: QTBUG-86089 Change-Id: Ie41563b34da17e7134631791ed024b31e87e21e3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Document internally the animation handling in the threaded loopLaszlo Agocs2020-09-072-13/+44
| | | | | | | | | | Also rename the incomprehensibly named maybePostPolishRequest(), because it is just a call to QWindow::requestUpdate() nowadays. postUpdateRequest() makes it clear what it is. Task-number: QTBUG-86089 Change-Id: I4c9ca1336c26d163772368067eda0f1ef84b9d97 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix qt.scenegraph.time.renderloop time logjiu2020-08-312-11/+5
| | | | | | Fixes: QTBUG-86209 Change-Id: Iea09d22f09df3b50ebdf55d1c72affb5603bdcda Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix format specifier error after sizetype changeFabian Kosmale2020-08-311-2/+2
| | | | | Change-Id: I8cf053270a7d2c17cb3c4313ff129610aeded59a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-301-3/+3
| | | | | | Pick-to: 5.15 Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>