aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Use a single code path to load a QShader in QSGRhiShaderEffectNodeLaszlo Agocs2020-11-231-13/+4
| | | | | | | Change-Id: I8fec25df83768883896d195c09489aeb23abdafd Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit ae1dc052b6b975b8a49d8d71d11d3051acd594c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused 'blob' member in ShaderEffect internalsLaszlo Agocs2020-11-231-1/+0
| | | | | | | Change-Id: I804f019f40dddce43646bf1cf91da26d4c3a4b5c Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 9f43ccc112b748ff79e175b7fec94ec60cf311ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Do not incorrectly leave srcAlpha and dstAlpha set to the defaultsLaszlo Agocs2020-08-281-2/+2
| | | | | | | | | | | | TargetBlend defaults to One, OneMinusSrcAlpha, One, OneMinusSrcAlpha when it comes to srcColor, dstColor, srcAlpha, dstAlpha. When setting a blending different than our standard premultiplied alpha, srcAlpha and dstAlpha must be set too. Otherwise what we get is something that is not equivalent to Qt 5's glBlendFunc() call. Change-Id: Ied03669edae9dcf3ec4c9c5b560195511db8d00b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix a bunch of compiler warningsLars Knoll2020-08-283-2/+3
| | | | | | Taks-number: QTBUG-86234 Change-Id: I4c945edecdbe55bc5587c18599d49dfb82ade1eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add renderTypeQuality property to Text elementEskil Abrahamsen Blomfeldt2020-08-1714-30/+60
| | | | | | | | | | | | | | | | | | | | | For large scale text, the default distance field size gives artifacts on certain font features. We already have an environment variable which overrides this on an application level, but this will cause all distance fields to be rendered at the high resolution, whereas you may just want it for one particular text field. Since this becomes an especially important use case now that we can embed the text fields in a 3D scene, we add a property which can be used to tweak the base font size used for generating the distance fields. [ChangeLog][QtQuick][Text] Added "renderTypeQuality" property, which can be used in cases of very large fonts, where Qt's font rasterization may show some rendering artifacts when using the default quality. Fixes: QTBUG-84696 Change-Id: Ie4205e82cf441562dcc65a8e432a941a3baeddf3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not create depth/stencil buffer when the env var says soLaszlo Agocs2020-08-165-22/+53
| | | | | | | | | | | | | | | | | | | | | | | Both for the swapchain and more importantly, layers. The latter was never implemented, not in Qt 5 with OpenGL either, and it becomes a problem for resource-limited use cases because QSG_NO_DEPTH_BUFFER still creates depth/stencil attachments for layers even though the 2D rendering has no use for those then. Clarify the QQuickGraphicsConfiguration docs as well. The story is fairly convoluted, because the useDepthFor2D flag one can set from C++ is not 100% the same as the env.var. (and it really should not be) The flag is about relying on depth testing in 2D (and so enabling the potentially more efficient opaque batches), but it does not prevent adding a View3D or other stuff that requires a depth buffer. The env.var on the other hand does both: it (depending on the platform) disables depth (and often stencil) buffers, thus using fewer resources, and also triggers the depth-less 2D rendering path (alpha batches only). But that is not always compatible with 3D then (like an offscren View3D will work, other modes may not) Change-Id: I5ac1ce154fe78a3ec8bd1a698c1c0b944ce8077e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Ship with optimized SPIR-V for the built-in shadersLaszlo Agocs2020-08-1154-50/+53
| | | | | | | | | | | | | Also includes stripping the shaders properly. While we do not have debug information, we do have OpName and similar that describe the variable and block member names. This is unnecessary in the final SPIR-V binary, and further reduces the size somewhat. To create debuggable shaders (for SPIR-V and D3D) with full source information, one needs to regenerate the relevant ones with -g instead of -O. Change-Id: I3b855ee4e9afe393cd460407c1a807d6c9c5e6c2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Force Batch Rebuild if SubtreeBlocked includes an opacity changeAndy Nichols2020-08-111-0/+5
| | | | | | | Fixes: QTBUG-85965 Pick-to: 5.15 Change-Id: I2f5aba7fbde7ad2149d408d29db9219f33f13ca8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix regression on antialiasing on outlined text for 3D render modeEskil Abrahamsen Blomfeldt2020-08-104-2/+2
| | | | | | | | | | 4da53ed1d6433730d0604b948ba3b5abeabd1eb0 fixed a regression on antialiasing in outlined text, but neglected to include the _fwidth versions of the shaders. Task-number: QTBUG-85514 Change-Id: If8bae04b680044b92c983776be6ceedd0c96f547 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix crash when QSGTexture is deleted in rc->endSync()VaL Doroshchuk2020-08-071-1/+9
| | | | | | | | | | | | | | | | | | | | | 1. When the quick pixmap is cached, it might be deleted by a timer. 2. When its QQuickPixmapData is being deleted, its QQuickTextureFactory is also deleted. Which informs the QSGRenderContext to postpone deleting of a texture that belongs to this texture factory. 3. When an update is called on the _hidden_ window, QSGGuiThreadRenderLoop::renderWindow calls rc->endSync(), which deletes postponed the texture from 2. After that the texture must not be used. But some QSGNode can still keep pointer to the deleted QSGTexture. and when updatePaintNode is called, it might produce a crash. So, suggesting a fix to inform the render loop that there is a window with pending updates, and no need to delete textures. Change-Id: I1487595dbb686e682ac3b91b9c3d21f401095daa Pick-to: 5.15 5.12 Fixes: QTBUG-65170 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix regression in antialiasing on outlined textEskil Abrahamsen Blomfeldt2020-08-058-4/+6
| | | | | | | | | | | | | | | After e8d9bc1bcada7d94af5a33d64a9afc860ede5b84, outline text would blend with the background rather than the fill color on the inner side of the outline. We should do the mix with the fill color like before this change, but for performance, we should still discard all pixels which are not part of the outline, which we do using step() instead of multiplying by 1.0 - a. Pick-to: 5.15 Task-number: QTBUG-85514 Change-Id: I4b252bdbd9dae5ee599ba7c5d1cc3609fef61622 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Switch to MTLTexture protocol in QSGTexture native accessLaszlo Agocs2020-08-044-27/+28
| | | | | | | Now only available from ObjC code. Change-Id: I88df6c8839fc660ffd2b8e88a789ca73a9d4accd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add type safe native texture accessorsLaszlo Agocs2020-08-0313-66/+598
| | | | | | | | Following the pattern from QtGui. Task-number: QTBUG-85239 Change-Id: I07b4456028d0f45223ad10e55ce65f423bab6a9b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Avoid -Wclass-memaccess warningFabian Kosmale2020-07-281-1/+1
| | | | | Change-Id: Ia5e6ed13528fac68fe9f5f5b13471b6806d53b21 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix multiple windows with Vulkan on basic render loopLaszlo Agocs2020-07-283-10/+28
| | | | | | | | | | | | | No problems with threaded, but when using QSG_RENDER_LOOP=basic with Vulkan we missed setting the Vulkan instance for the second, third, etc. window. The problem can be seen with the quick/window example, running it with QSG_RHI_BACKEND=vulkan QSG_RENDER_LOOP=basic makes it fail. With the patch it will function as expected. Change-Id: I98e7cb5ff960200dadb2fcbc30f771f9a7d9a9ae Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QSGTexture: Remove doc references to bind()Laszlo Agocs2020-07-061-9/+8
| | | | | Change-Id: Ibcdf6cb940c0f95a5baba0887b01a149611dfe04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* layer: Check for <1 not ==0 when bailing out due to no sizeLaszlo Agocs2020-07-061-1/+1
| | | | | Change-Id: I87798db04e0bca6c2ea173b1b946549a747b2124 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix before/after frame signal emissionsLaszlo Agocs2020-07-012-4/+6
| | | | | | | | | Make the before signal closer to the actual QRhi::beginFrame() call. This fixes emitting a beforeFrameBegin unnecessarily when unexposing and then exposing a window again. Change-Id: Icc562a57798986c8d04c6800eabc41981c5da85b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make it possible to specify an adapter or physical device onlyLaszlo Agocs2020-06-291-2/+16
| | | | | | | | | As required by OpenXR. While we are at it, make the API a bit more type safe. Change-Id: I3c6152feeb71359056830ab02d35f8cb258722c0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-266-8/+8
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add what-would-my-graphics-api-be getterLaszlo Agocs2020-06-261-0/+2
| | | | | Change-Id: I2bf50a46ea18fe06068192ad695652830c3a3861 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add links to examples in scenegraph docsLaszlo Agocs2020-06-242-0/+8
| | | | | Change-Id: I00192314cdb954acdd4f933eec912cffab3584c6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Defer setting a QVulkanInstance on the windowLaszlo Agocs2020-06-221-0/+9
| | | | | | | | ...to createRhi(). There is no need for the VkInstance before that point. Change-Id: I87f4e8154e96409bccd7844f1bf80b957bb54d69 Reviewed-by: Andy Nichols <andy.nichols@qt.io>