aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Delay the deletion of QSGTextures until all windows are synchronizedDominik Holland2017-06-163-0/+4
| | | | | | | | | | | | | | | | With the 'basic' and the 'windows' render loop the scene graph context is shared. Because of this we cannot start deleting textures after the first window is synchronized as it may contain textures needed by the another window, which is not yet synchronized. QWindowPrivate::syncSceneGraph() is not calling endSync() anymore as it doesn't know whether it is the last window or not. Instead the renderloop is now responsible for calling endSync() once this is safe to do. Change-Id: Icb50ebfb447c928e38b41df7e26f3bfafdb4a811 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Build for for -no-feature-quick-spritePaul Olav Tvete2017-03-226-3/+19
| | | | | Change-Id: Iaf26d9cec7f9fa7a5d6d24c729b2dc92737cca1f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* OpenVG: Fix glyph cache to actually ref countAndy Nichols2017-02-282-13/+15
| | | | | | | | | In my haste to add the code to cleanup unused glyphs I neglected to add the coded needed to ref count the glyphs. So glyphs that were being used more than once were getting removed too early. Change-Id: If3fa083313c345beac6705956067bee0932f7f60 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix a compilation issueJędrzej Nowacki2017-01-312-4/+5
| | | | | | | | | | | | | src/plugins/scenegraph/openvg/qsgopenvgglyphnode.cpp: In member function ‘virtual void QSGOpenVGGlyphNode::render()’: src/plugins/scenegraph/openvg/qsgopenvgglyphnode.cpp:146:90: error: ‘ceil’ was not declared in this scope offscreenSurface = new QOpenVGOffscreenSurface(QSize(ceil(m_bounding_rect.width()), ceil(m_bounding_rect.height()))); src/plugins/scenegraph/openvg/qsgopenvgglyphnode.cpp: In member function ‘virtual void QSGOpenVGGlyphNode::render()’: src/plugins/scenegraph/openvg/qsgopenvgglyphnode.cpp:146:90: error: ‘ceil’ was not declared in this scope offscreenSurface = new QOpenVGOffscreenSurface(QSize(ceil(m_bounding_rect.width()), ceil(m_bounding_rect.height()))); Change-Id: I9993d9629d70eb6031b91c3827e3e2d79b0e1ffc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix qtdeclarative compilationPaolo Angelelli2017-01-245-22/+93
| | | | | | | | On ubuntu 14.04 building qtdeclarative from the dev branch is impossible due to various errors in the openvg plugin. Change-Id: I1f2d7d61c36428e64cf3248e550ac5c4f0baa4b0 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* QSGThreadedRenderLoop: Correctly stop the animation timer ...Robin Burchell2017-01-121-0/+5
| | | | | | | | | | | | | | | | | | | ... when destroying the last window while it is still visible. For the case of windowDestroyed(), the QQuickWindow can still be isVisible true and isExposed true. Given these circumstances, we would not stop the timer (assuming that we needed to keep it running), but this is actually wrong when we are evaluating a timer change depending on the window being destroyed. By calling startOrStopAnimationTimer again, after the window has been removed from m_windows, we will successfully stop the timer -- the only cost being an unnecessary polish event being sent from the first call (which will be ignored). Task-number: QTBUG-58091 Change-Id: I043ce5d88eafee15019e1c8d41c06d531d1da059 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Fix Q_QUICK_SG_PROFILE macros in OpenVG renderloopAndy Nichols2016-12-251-4/+8
| | | | | Change-Id: Ied37cc78b5338d17bb72735061be24cb20501d57 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-143-35/+73
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8Liang Qi2016-11-282-12/+24
| |\
| | * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-282-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The renderers added in 5.8 had to be adapted to the changed profiling macros from 5.6. Conflicts: src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp src/quick/util/qquickprofiler_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp Change-Id: Icb370b7c95aab12589ad73881ac6d178759a5c6b
| * | D3D12: Output error messagesFriedemann Kleint2016-11-281-23/+49
| |/ | | | | | | | | | | | | Format error messages via struct _com_error. Change-Id: Ice755597ec56a106e9fc5ac0288b69d9411a6ea8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-1/+4
|\| | | | | | | Change-Id: I905dcd29377bf1b2e0ee086823b54277d18e78dd
| * D3D12: Fix RESOURCE_BARRIER_BEFORE_AFTER_MISMATCHLaszlo Agocs2016-11-251-1/+4
| | | | | | | | | | | | Change-Id: I531d53c81d5ab19bba22f883bc802ecc8d02590d Task-number: QTBUG-57234 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | OpenVG: Fix Recursive LayersAndy Nichols2016-12-135-13/+56
| | | | | | | | | | | | | | | | OpenVG also needed to ping-pong between two offscreen surfaces like the OpenGL renderer. Change-Id: I41f671d98d361eb114be5c00ebfe62710a971aaa Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | OpenVG: Use QRawFont qHash function in font cacheAndy Nichols2016-12-132-28/+3
| | | | | | | | | | | | | | A qHash function was added for QRawFont, so use that instead of our own. Change-Id: Iad8deb8a0e2a727039ec752e38e42cef2127735c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | OpenVG: Support rendering paths with non-affine transformsAndy Nichols2016-12-1319-197/+586
| | | | | | | | | | | | | | | | | | | | | | | | The current approach to rendering paths (used by Rectangles and Glyph nodes) does not support rendering with non-affine transformations. That is because OpenVG does not support passing a non-affine transformation matrix when rendering paths. So instead when using a non-affine transform we will fallback to rendering to an offscreen VGImage, then rendering that as an image which can have a perspective transform. Change-Id: I01508bcb67b339323cb6400c7ff6d885b62c5e02 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | OpenVG Scenegraph AdaptationAndy Nichols2016-12-1339-0/+6045
|/ | | | | | | | | | | | | | | | | | This is an OpenVG backend for the Qt Quick 2 scenegraph. Should be feature complete now, but there are still some issues that could be improved in future commits: If Rectangle nodes are rendered with a non-affine transform, they will be rendered incorrectly. This is because paths expect affine transformations. The Glyph cache is a bit cheeky in that it's caching paths, but doing so per font size. It shoudln't need to, but right now I've not though up a good way of getting the transform/scale needed when rendering yet. Change-Id: Ie3c4f2df35d14279b0f9f55e0e10a873328c025b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Move rebuildGeometry() functions of nodesFriedemann Kleint2016-11-221-9/+5
| | | | | | | | | | | | | | | Move QSGDefaultImageNode::rebuildGeometry(), QSGDefaultNinePatchNode::rebuildGeometry() to QSGImageNode::rebuildGeometry(), QSGNinePatchNode::rebuildGeometry() respectively. This makes it possible to use then from the D3D12 plugin when built without OpenGL support. Task-number: QTBUG-57185 Change-Id: Ib88c5622f7048618151a63d7536d76296a25842e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QSGRendererInterface: Add Resource suffix for consistencyLaszlo Agocs2016-11-181-3/+3
| | | | | Change-Id: I60e674760725d4c4dd13f53b31c3abb6b09c1790 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* d3d12: Use qtConfig() in place of config_d3d12 for the pluginLaszlo Agocs2016-10-171-1/+2
| | | | | | | | | | This one last occurrence of config_d3d12 was apparently missed in the previous patches, leading to not compiling the plugin in fresh, clean builds at all. Change-Id: I696d902990b867cf7e6c79a41697e4524e6ee21b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix d3d12 plugin compilation after QSGGeometry API reviewLaszlo Agocs2016-10-141-3/+4
| | | | | | | Missed the fact the semantic is now attributeType in the public API. Change-Id: I9c967fd24d904c2886054768bb626a62d291b8ba Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix enums in QSGGeometryLaszlo Agocs2016-10-124-11/+11
| | | | | | | | | | | | | | | | Minor fixes based on comments from the 5.8 API changes review: Revert to using Qt-style enum values (POSITION -> PositionAttribute). Use ByteType, FloatType, etc. instead of TypeByte, TypeFloat, ... Add comments about magic GL values. Add missing docs for Attribute::createWithAttributeType(). Change-Id: I1b8242efd3936f000ce8df6c11ff9ab7affb5713 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge dev into 5.8Oswald Buddenhagen2016-08-225-26/+59
|\ | | | | | | Change-Id: If0f273d3d33cec20edda539de6372337c2e4e969
| * D3D12: Convert 8-bit glyphs to 32-bit to prevent using R8 formatsLaszlo Agocs2016-08-175-26/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | Until we figure out why DXGI_FORMAT_R8_UNORM sampling produces weird results with AMD cards, disable it and convert to RGBA. The check could be done at runtime based on the device's VendorId (0x1002), however the shader needs changes too so it would make things more convoluted. Hence only a compile-time define for now. Task-number: QTBUG-55330 Change-Id: I73f038cf0aeba742e8ea6669359c8a6e8e400a06 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | winrt: Make certification pass on D3D12 backendMaurice Kalinowski2016-08-171-0/+4
|/ | | | | | | | | D3D12GetDebugInterface is not allowed to be used in a package to be uploaded to the store. However, keep it enabled for debug to still access information provided by it. Change-Id: Ie19167b4000b85d519d9726a66a42c6f1ef6ce4c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix static buildMaurice Kalinowski2016-08-091-11/+11
| | | | | | | | When compiling statically QSG_LOG_INFO is exported in QtQuick as well as the plugin causing problems when linking eg qmleasing. Change-Id: I9f86c0140c39f129e859b6b0e9eed43a9b7ce928 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix winrt buildLaszlo Agocs2016-08-022-0/+4
| | | | | Change-Id: I91a90a9141bd17b01a9b87d8ad39c11f8b386a8c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove some unnecessary includesUlf Hermann2016-07-261-1/+0
| | | | | Change-Id: I18f2b6f44decf5ecde45e20722541b9a18d60b16 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* D3D12: clean up loggingLaszlo Agocs2016-07-192-35/+38
| | | | | | | | | | | | Make QSG_RENDERER_DEBUG more fine-grained, the maximum set is now loop;build;change;render;descheap;buffer;texture;shader meaning "render" is broken up into 5 categories. Fix also a comment on the root signature to avoid future headache with trying to optimize the descriptor table for textures away (in vain). Change-Id: I06a2a624ed39aaf5de42b8e984a192c7966360ab Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* software: Add support for QSGRenderNodeLaszlo Agocs2016-07-196-6/+9
| | | | | | | | | | | | | | | | | Have to change getResource() a bit since it turns out it is not suitable currently for backends that do not have a per-window rendercontext and do not implement the interface on the rendercontext. Pass in the window to make sure it can always figure out which window we want the resources for. (we do not want rendererInterface() to return window-specific instances created on the fly, with ownership issues, so stick with the simple model where backends implement the interface on one of their existing classes) To support clipping, QSGRenderNode::RenderState is extended accordingly. Also updated the docs since some claims in the rendernode docs are not true since Qt 5.3. Change-Id: I34779c83926f5231b888fcab7131e873ae97964f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Move swapchain/color buffer format to a constantLaszlo Agocs2016-07-191-9/+11
| | | | | | | | So it can be changed to BGRA, if desired, although tests show that BGRA reduces perf a little bit in fact. Change-Id: Ieb87bba2298426f1503658f8dffb0c659c265ca5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Show a warning when the requested adapter is not usableLaszlo Agocs2016-07-191-5/+9
| | | | | Change-Id: I3cbc4bf45b22f8bf772163be24ca4c9ccb63fcad Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Change the command list size limitLaszlo Agocs2016-07-151-1/+4
| | | | | | | | 128 is way too low. Experiments with qmlbench show that there is not much improvement after 4000 so go with 4096. Change-Id: I1fd8f4f55250b5e54d95adb28b4ea1f4fe5ca10a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix unused var warnings in release buildsLaszlo Agocs2016-07-153-2/+4
| | | | | Change-Id: I83c3582ca7cb9523fb0e90627f2575992e84694c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Add support for QQuickWindow::setDefaultAlphaBufferLaszlo Agocs2016-07-151-1/+7
| | | | | | | | | | Transparency won't work yet, though. The existing mechanisms are disfunctional with our flip model swapchain. Will have to investigate DirectComposition perhaps. In any case, having the alpha size correct in the window's format() is a good thing. Change-Id: Ia8304f90700d9fb5bd71e3e1bd95d2eda0acab38 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Support translucent windows via DirectCompositionLaszlo Agocs2016-07-146-34/+117
| | | | | Change-Id: I1b63db07ade1ae43c67352b4d875d5a3e55105f2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Sprite nodeLaszlo Agocs2016-07-147-5/+465
| | | | | Change-Id: I5ef2fb20beed372996642caf2cc5e02eaa886d79 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add QSGSpriteNode to the Scenegraph Adaptation LayerAndy Nichols2016-07-144-0/+14
| | | | | | | | | | | | Most core Qt Quick items use one of the nodes provided by the Scenegraph Adaptation Layer, however the two items that provide support for Sprites created their own custom nodes. There was significant redundancy in this, and it made it only possible to use the OpenGL adaptation. The AnimatedSprite and SpriteSequence items have been cleaned up, and now use the new QSGSpriteNode. Change-Id: Idc20b9c5da9dc1c94f6368021785382cdf7cec5a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* D3D12: Fix descriptor range referenceLaszlo Agocs2016-07-051-7/+7
| | | | | | | Prevent it from going out of scope. Change-Id: I230937cdb59545e04a7da64a6a68970a2e1f5522 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Print what goes wrong in rootsig serializationLaszlo Agocs2016-07-051-1/+2
| | | | | | | | This is not something the debug layer handles so we have to warn ourselves if we want to know what is going on. Change-Id: If412234923a4ce977618d240f4e9dd8890182fd2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Improve debug layer supportLaszlo Agocs2016-07-011-2/+28
| | | | | | | | | | | | | | | Filter out the annoying RT clear color warning which we have no control over if the user called setColor on the QQuickWindow and a non-default render target is in use. Start breaking on serious error messages and make it possible to break on warnings as well. (QT_D3D_DEBUG_BREAK_ON_WARNINGS) All of this is only relevant when the debug layer is enabled. (QT_D3D_DEBUG) Change-Id: Idfc6e3f3165ea50b54938d358543763bc7433c7c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Move the info prints to categorized loggingLaszlo Agocs2016-07-011-14/+22
| | | | | | | | Print info messages on startup only when QSG_INFO / qt.scenegraph.general are set, similarly to what happens with OpenGL. Change-Id: I11c0329462bb6f66968246c4412fff940797671b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix 8-bit QImage mappingLaszlo Agocs2016-07-011-1/+7
| | | | | | | | | The engine treats these specially due to the glyph textures sharing the same code path, but ordinary images do not need this. Convert them to 32-bit instead like it's done with OpenGL. Change-Id: If484e61c7269e55ba4ebaaba34819e064c10be7c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Advance anims in sync with vsync in the RLLaszlo Agocs2016-07-012-44/+185
| | | | | | | | | | Make the default render loop behave like the 'windows' one does with OpenGL: advance animations manually after each render step. This provides much better results than the previous approach (i.e. 'basic') where the animations became quite jerky with heavier workloads. Change-Id: Ic933e136479d2a04036af15212669027ef2408c3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix expose handlingLaszlo Agocs2016-07-012-4/+18
| | | | | | | | | | | | to avoid unnecessary rendering attempts when closing windows containing certain Quick Controls (1). Basically this introduces a condition that is there in the threaded loop's polishAndSync but was missing from renderWindow. When the window is not "exposed" either normally or via grab(), it should just return. Change-Id: I42602e33ba144a1c56586a4b92fa088e85099d0d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Fix grabbing with the new gui thread render loopLaszlo Agocs2016-07-012-20/+36
| | | | | | | | | Grabbing was not completely ported from the separate render thread based version, and so some of the grab tests in tst_qquickwindow did not pass. This is now corrected. Change-Id: I830d9b439082cf8ebc1bfe75ce756ef5dd7c54c0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Avoid multiple invalidated signalsLaszlo Agocs2016-07-014-25/+20
| | | | | | | | | | Calling invalidate() multiple times for any reason should only result in doing cleanup and emitting signals once. The somewhat weird manual pending flag is also removed now. Change-Id: I46eca63a300fe9acb4ebd0bd9b601d8583dced1c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Add support for shader sources in filesLaszlo Agocs2016-06-292-13/+25
| | | | | | | | | Now we support all combinations: source strings, HLSL source in files and bytecode in files. The type of file contents is detected automatically. Change-Id: Id6ab269df52463fb95a9a1ef2598ed5576a873d3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Add support for file selectors in ShaderEffectLaszlo Agocs2016-06-292-1/+8
| | | | | | | | | | | Now that both OpenGL and D3D supports files, it is trivial to add support for file selectors. This means that one can add for example a shaders/wobble.frag with GLSL source code and a shaders/+hlsl/wobble.frag with D3D bytecode, while simply writing fragmentShader: "file:shaders/wobble.frag" in QML. The rest is automatic. Change-Id: Iaf71a6998bbd31050bc6c2b2f33b03d27c59fb6c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Unify ShaderEffect property settingLaszlo Agocs2016-06-295-35/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rendererInterface() should not require isSceneGraphInitialized() to be true - the API and language queries like graphicsApi() have no need for the scenegraph, they only need the plugin to be loaded, i.e. that the QQuickWindow is constructed. This is the key to be able to make GraphicsInfo report graphicsApi and shaderType with the correct values as early as possible - meaning as soon as the item is associated with a window. The initialization of the scenegraph (the exact timing of which varies backend to backend) does not matter here. The fragment and vertex shader property setting is now unified in the two ShaderEffect implementations: - If the component is complete, the shader is attempted to be processed right from the setter. - Otherwise the item will trigger processing once the component is complete. - If there is no window when processing is trigerred, it is deferred via polish. To implement item polish handling we need a new virtual in QQuickItemPrivate since we cannot intrdouce virtuals into the public classes. This way one can write a condition (and later potentially use file selectors) like this: fragmentShader: GraphicsInfo.shaderType == GraphicsInfo.GLSL ? "..." : ... without having to worry about getting an unintended value processed due to GraphicsInfo not yet reporting an up-to-date value. parseLog() forces, for GL at least, shader processing to prevent autotests from breaking. Change-Id: If55c69d746c29cd07348ddad2d6b0f2b5dd7f3a2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>