aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickshadereffect.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Add missing } and indent accordinglyAndy Shaw2021-03-201-1/+2
| | | | | | | Change-Id: I11331f0f0434f2888d1f64aa01f999f42a15bdda Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 13ab07e932725d8c76208c265b60031e37305704) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused external function declaration in ShaderEffectLaszlo Agocs2020-11-241-2/+0
| | | | | | | Change-Id: I05e3f804af3668235f97cebc54e1904a90092385 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit a10c980b1e4273b357702211148a2f9c4e2ebc2c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-enable the caching of shader data loaded from filesLaszlo Agocs2020-11-231-8/+8
| | | | | | | | | | | | | There was a mismatch for the cache key: sometimes using the original url as specified in the QML code, sometimes using the resolved url (which has, for example, a relative path expanded to absolute). Change this to be consistent. Fixes: QTBUG-88673 Change-Id: I201750716d3ba6dbe73a4799ac56f26f9b8ec820 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit f95b99902fae6e53a9da5fbccb6e1616299fb3bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-051-3/+0
| | | | | | | | | | | - 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>
* QQuickShaderEffect: fix crash when hiding parentMitch Curtis2020-10-151-1/+5
| | | | | | | | | | | | It's possible for itemChange to be called during destruction when deleting the QQuickShaderEffectImpl. We nullify m_impl before deleting it via another pointer to it, so we must check that it's not null before trying to use it. Pick-to: 5.15 Fixes: QTBUG-86402 Change-Id: If4955445f7cc0d1f376bc9b86b95e1cca4d88ede Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix leftover argument names in ShaderEffectLaszlo Agocs2020-06-301-26/+22
| | | | | | | | | | | "code" is misleading, and is a leftover from earlier times when the value could have contained actual source code as well. We now have a plain QUrl that is a local or qrc file reference. Update function argument names accordingly. Also remove a confusing comment that was again relevant when these properties were plain strings. Change-Id: Ie88040d0c300a33167518098399dc0d1722a5961 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QQmlContext::resolvedUrl in places where it was not addedLaszlo Agocs2020-06-301-4/+2
| | | | | | Fixes: QTBUG-85063 Change-Id: Id96fe228a840de0f4760474db8bd9b1031640b50 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Reimplement UniformAnimator for ShaderEffectJonas Karlsson2020-06-291-13/+81
| | | | | | Fixes: QTBUG-83976 Change-Id: I307e96be0d3d2edeb8d9065d100c1ef38c8824c7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update ShaderEffect docsLaszlo Agocs2020-06-181-122/+204
| | | | | | | | | | | | | | The two ShaderEffect related snippets are removed, with the relevant code folded into the documentation itself. We cannot support standalone snippets with custom shaders as we'd need to have separate shader files, qsb files, scripts to build, etc. This is not reasonable at this point. In layerblending.qml the ShaderEffect serves no purpose, apart from providing a fancy background that is irrelevant to the topic. Just remove that. Change-Id: I726f029c8b7096938aa609031e391e9e57ef1655 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* ShaderEffect: vertexShader and fragmentShader are now URLsLaszlo Agocs2020-06-181-50/+46
| | | | | | | | | | | | | | | | ..and so fully compatible in behavior with properties like Image.source. The main improvement here is that unlike with the old code, which incorrectly handled local file URLs, one can now write fragmentShader: "myshader.frag.qsb" which leads to picking up the file relative to the component (the .qml file), as expected. Existing code (that uses file: or qrc: URLs) will continue to work as-is. Change-Id: I89dd84b998b59ae6d5b6cb3d8a6353961ee8bb4a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Clean up QT_CONFIG(opengl)Paul Olav Tvete2020-06-171-2/+0
| | | | | | | | | | Accelerated graphics is now possible without OpenGL support. With this change, a Qt build with -no-opengl can still run Qt Quick with a Vulkan, Metal, or Direct3D backend. Fixes: QTBUG-84027 Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove QQuickGenericShaderEffectPaul Olav Tvete2020-06-101-2/+778
| | | | | | | | | | | | Keep it as an internal class for now, with the name QQuickShaderEffectImpl, and move it to qquickshadereffect.cpp. In the long term, we want to get rid of the extra QObject, but that requires careful untangling of the connections and the timing of cleanup at destruction. Task-number: QTBUG-83977 Change-Id: I6513bd0d8fc8522a15049b70ab43fc222088e7d0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove QQuickOpenGLShaderEffectPaul Olav Tvete2020-06-041-141/+1
| | | | | | | | | This also removes QQuickUniformAnimator, which is not yet ported to RHI (QTBUG-83976) Task-number: QTBUG-83977 Change-Id: I3e656e6817ac991371b7f6557f050e122635d279 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QQuickItem: rename geometryChanged to geometryChangeMitch Curtis2020-04-231-3/+3
| | | | | | | | | | | | | | | | | | This brings it in line with the existing convention in this and other modules, where virtual handlers are named "nounChange"; e.g. itemChange. Signals are named "nounChanged". This also allows adding a geometryChanged signal, which would enable users to listen to one signal for all changes to x/y/width/height. [ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange in order to follow existing naming conventions and have consistency with existing API, such as itemChange. Task-number: QTBUG-82994 Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove D3D12 scenegraph backendLaszlo Agocs2020-01-061-224/+15
| | | | | | Task-number: QTBUG-79925 Change-Id: Id3f0a688f47efaf1653c85d23ef49618ed09c931 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add the graphics api independent scenegraph portLaszlo Agocs2019-07-041-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-131-0/+2
|\ | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4memberdata.cpp Change-Id: I4e9ffc89d65279a42516f5547e93fb47fb571834
| * Avoid assertion when having a ShaderEffect as a delegateJan Arve Sæther2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion occurred when it initially tried to create an item from the delegate because it needed to show the contents of the first item when the combobox was collapsed. So, in order to do that ComboBox would create an object from the delegate by calling delegateModel->object(). Since the ShaderEffect was not ready to be constructed yet (it didn't have a window, see QQuickOpenGLShaderEffect::maybeUpdateShaders() ) it would call polish on itself in order to try later. Shortly after, it called delegateModel->release(). This didn't delete the object immediately (it called deleteLater() on the object), but it removed the engine and context it was associated with). However, this left it in the list of QQuickWindowPrivate::itemsToPolish. Due to this, QQuickWindow would call updatePolish on it shortly after (as a response to an expose event in our case). But the ShaderEffect was still not associated with an engine, so it would ultimately assert with no engine. The fix is to simply check if the ShaderEffect has an engine, and return early if that happens. Then when the dropdown opens, the ShaderEffect will get a polish() because of QQuickItemPrivate::recursiveRefFromEffectItem(), and it will have both an engine and a window and will properly initialize its shaders. Fixes: QTBUG-67343 Change-Id: Ib8ceb92d0fafb9b958407a50db5daa7b45e1d82a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix mistakes in 9b36512b9453f429644b0c388d381f7a2fc0f825Allan Sandfeld Jensen2019-05-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Undo change to signature of textureProviderDestroyed, and reinstate test for disconnected item having a window, and instead ensure we are destroyed earlier while the item is still valid. Fixes: QTBUG-76055 Change-Id: I0c6c13cd44d3364984e0245b3b048f4aa183b43a Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Avoid illegal downcasts in texture and shader handlingAllan Sandfeld Jensen2019-05-151-1/+2
|/ | | | | | | | | | Fixes bad type-cast during destruction when objects no longer has the full type they used to. Detected by UBSAN. Change-Id: I4867091901d70d5a882656834eb97a704def1751 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-1/+1
| | | | | Change-Id: I0c01862dbb475494c84e39c695cb563df8cbcfa8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix capitalization in section titlesTopi Reinio2017-08-291-1/+1
| | | | | | | | ...and fix some section titles to be less confusing. Change-Id: If83c3faffead9e2e9be7fc0fb360f1c5b8b1bb51 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+2
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Build fix for configure -no-openglPaul Olav Tvete2017-03-221-0/+2
| | | | | | | Change-Id: I21f111a04d9e2ce367d7677dbb48abbd591a4e71 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix regression with UniformAnimator target property validationJoni Poikelin2017-02-011-0/+5
| | | | | | Task-number: QTBUG-58549 Change-Id: Iaa2a9cd8b86e8c2bb7e20b99fabad99d0bd51799 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-24/+24
| | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc cleanup for D3D12 and SWLaszlo Agocs2016-07-141-1/+3
| | | | | | | | Fix formatting, wrong class names, and remove sprites as an unsupported feature. Add a note about the glslcore file selector. Change-Id: I2caffc4485157d053bb0fffa47fed8ee1d506774 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update ShaderEffect docsLaszlo Agocs2016-06-291-15/+117
| | | | | Change-Id: If20fa968fa596c82aa8eacbaedde9fa8ead5a8fd Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Unify ShaderEffect property settingLaszlo Agocs2016-06-291-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* D3D12: Support runtime threaded shader compilationLaszlo Agocs2016-06-221-4/+26
| | | | | | | | | | | | | | Let's revise our policy of offline/bytecode only shaders. ShaderEffect benefits greatly from having runtime compilation support for HLSL source strings, especially when dynamically constructing shader strings. There is no reason not to support both approaches since we rely on d3dcompiler for reflection anyhow. What's more, we can call D3DCompile on a dedicated thread, keeping the gui responsive while compilation is on-going. Change-Id: Ie6c02c2aa0ebd0c8371bbf30b3ce6582128c457b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* One GraphicsInfo to rule them allLaszlo Agocs2016-06-011-117/+5
| | | | | | | | | Rename RendererInfo to GraphicsInfo. Deprecate OpenGLInfo and move the surface format properties into GraphicsInfo. Move also the shader info properties from ShaderEffect. Change-Id: I3b3f01080e059b3a30a132fd67de19a4bfca54ef Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix building with QT_NO_OPENGL definedAndy Nichols2016-05-061-1/+4
| | | | | Change-Id: Ice6c47f766899e7313b9dde8cfcd6d81eeaf52f5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* D3D12: Fix 'ShaderEffect in a ShaderEffectSource as property value'Laszlo Agocs2016-04-291-12/+55
| | | | | | | | | | | | | | | | Import (and clean up) the dropshadow from the shadereffects example. This is very useful since it tests a lot more paths and cases than the wobble. To overcome the issue of not having some of functionality available before the item is added to a window, make QQuickGenericShaderEffect smarter and enhance the documentation. The handling of vertical mirroring is revised. The GLSL and HLSL version of the dropshadow shaders produce correct, identical output now. Change-Id: I94800997bfba781140d80720eb6f340cda480747 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Adaptable shader effect enablersLaszlo Agocs2016-04-291-26/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The D3D12 node implementation is mostly missing. The rest of the enablers should be in place now however. Importing QtQuick 2.8 provides new properties for ShaderEffect: - shaderType can be used to decide which language should be used - shaderCompilationType tells if compilation is runtime or offline - shaderSourceType tells if the vertex/fragmentShader properties refer to source strings or source files or pre-compiled bytecode files The last two are bitmasks. In practice however we will support only one approach per backend for now (runtime + source string for OpenGL, offline + bytecode for D3D12). In addition to QSGShaderEffectNode, introduce the QSGGuiThreadShaderEffectManager interface. This provides the gui thread bits for the above and performs shader reflection. Backends that use the new ShaderEffect system must provide both. For each ShaderEffect item there will be a manager (on the gui thread) and a node (on the render thread). Reflection is expected to be done via standard helper libs (d3d12shader + D3DReflect from d3dcompiler for the D3D12 backend), or via manually inspecting SPIR-V, or parsing the source (like the GL path does now), or by using some 3rd party library (not recommended). In any case we require that reflection is doable on the gui thread without dependencies to the actual graphics API. The ShaderEffect documentation is greatly extended, covering HLSL and the new properties. The test app uses manually compiled shaders on its HLSL path for now. This is because there is no story yet for build system integration for public use (the internal HLSL -> bytecode in C header rule is only suitable for the d3d12 plugin itself, apps need something different). Change-Id: Id112104906fbcb26b9902a35f19d8d509b340d1b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add the skeleton for the new, more generic shader effect implLaszlo Agocs2016-04-131-40/+61
| | | | | | | | | which should route and place most of its work into the scenegraph. And fix a test. Change-Id: I04f29cba53c2bab62e41b3b524794d3c4d20a472 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Route ShaderEffect through the old GL implLaszlo Agocs2016-04-131-0/+137
| | | | | | | | | | | | | | Register the common QQuickShaderEffect class as ShaderEffect to QML. In case of GL this will route to QQuickOpenGLShaderEffect. For others the default no-op implementation is used (at least for now). Later this new implementation will route to a backend-specific scenegraph node via the adaptation layer. This also means that QQuickOpenGLShaderEffect is no longer a QQuickItem and QQuickShaderEffect must handle everything item-related and forward. Change-Id: I1ff4b674253543a04978a69f4a3b67f3a44dd983 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Prefix GL-specific shader effect codeLaszlo Agocs2016-04-131-781/+34
| | | | | | | | | | | | | | | | | | | | Rename the C++ sources and classes. The QML type name remains the same. No changes in functionality. The shader effect, node, material (and uniform animator and particles and bits and pieces here and there...) are highly interconnected and do not follow the usual design practices for Quick and the scenegraph and the adaptation layer. Therefore while we aim for keeping full compatibility for GL apps, other backends will likely get a different ShaderEffect item implementation. The C++ class QQuickShaderEffect itself is currently a dummy with an unchanged API. It is not in use for now but forms the basis for the implementation for other backends. This will be covered in future commits. Change-Id: Ia39ce4b303f8f33e2f241d11e35fa62423e43127 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Make QQuickShaderEffectMesh genericLaszlo Agocs2016-04-131-20/+7
| | | | | | | | | There is nothing GL-specific here (apart from the attribute name list but that will likely remain that way with non-GL backends as well). By moving a few constants it can now be built unconditionally. Change-Id: I866b7b5c0262588a39818b177455f6276f8d584b Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-081-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also fixes the build of two benchmarks, tst_affectors and tst_emission. Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro src/qml/qml/ftw/qhashfield_p.h tests/benchmarks/particles/affectors/tst_affectors.cpp tests/benchmarks/particles/emission/tst_emission.cpp tests/benchmarks/qml/pointers/pointers.pro tests/benchmarks/qml/pointers/tst_pointers.cpp tests/benchmarks/qml/qmltime/qmltime.pro tests/benchmarks/qml/qquickwindow/qquickwindow.pro Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
| * Move Qt Quick resources under the :/qt-project.org/ directoryGiuseppe D'Angelo2016-04-011-2/+2
| | | | | | | | | | | | Change-Id: I7c7745264ff66b7db042e19f6d44124fa78bb86c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-0/+8
|\| | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| * Ensure ShaderEffect correctly updates with supportsAtlasTexture.Michael Brasser2016-03-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given a simple ShaderEffect with supportsAtlasTexture: ShaderEffect { property variant source: myImage supportsAtlasTextures: true } ensure the atlas subrect used by the ShaderEffect is updated if myImage.source changes. Change-Id: I4560b80ba38c3487b16f53411451fb9891920738 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Fix a mix-up in ShaderEffect QML type documentationJuha Turunen2015-12-081-5/+5
|/ | | | | | | | | The description of the default vertex shader was documented under the fragmentShader property and vice versa. Change-Id: I2d609d7621f8478671ff96d787b1f4464ccb62f8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Include doc note about Image::fillMode being excluded by shader.Gunnar Sletta2015-09-111-2/+6
| | | | | | Change-Id: I8731ea81421e8f6cea7d59bea82030d0855b0054 Task-number: QTBUG-48113 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Doc: resize tables with overflowNico Vertriest2015-06-251-3/+8
| | | | | | Task-number: QTBUG-46475 Change-Id: Iebb2f7677f8b514d2b3e08480abfc98a0e155c1c Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Allow batching ShaderEffects without atlas samplersJocelyn Turcotte2014-12-181-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is currently necessary to set supportsAtlasTextures to enable batching of all ShaderEffect, even if they sample a ShaderEffectSource or have no sampler uniform at all. After fccbe57258c10e18ccdbbec405f5522dbd97af66 it is not necessary to set the RequiresFullMatrix flag based on supportsAtlasTextures since this now prevents batching altogether. Limiting batching should however also first verify that there are any sampler of the atlas used on that ShaderEffect in QQuickShaderEffectMaterial::compare, since that check wouldn't have any effect in QQuickShaderEffect::updatePaintNode through RequiresFullMatrix. Also make sure that using texture()->normalizedTextureSubRect() as the texture coordinate attribute is synchronized with calls to removedFromAtlas for all samplers and make sure that this only applies when the texture count == 1. This fixes a bug where setting supportsAtlasTextures on a ShaderEffect with more that one sampler would incorrectly use the texture coordinates of the first atlas texture in the geometry. This patch also removes: - The unneeded check for the RequiresFullMatrix in compare; the same program can be used in batched geometries and the renderer itself will prevent merging in that case. - The possibly heavy string comparison of m_source; QQuickShaderEffectMaterial::type() and QQuickShaderEffectMaterialKey are doing that for us more efficiently. I updated the documentation to clarify the 1-texture rule and explain the difference with qt_SubRect uniforms and when one or the other should be used. Change-Id: I85a86b8e7cb76f1536d5fcd369c7889f22537846 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Give Item::layer documentation some much needed love.Gunnar Sletta2014-09-291-0/+24
| | | | | Change-Id: I31e038d961d3aa09a36db0c091c4e4910e395c2e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>