aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/nodetypes/nodetypes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix outdated BSD license headerKai Koehne2017-10-171-3/+13
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* D3D12 manual test: add an async, uncached image loading testLaszlo Agocs2016-05-311-1/+2
| | | | | Change-Id: I8901a67d9e2b3343ba3f57775f1849400f6cdf18 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Implement grabWindowLaszlo Agocs2016-05-061-1/+12
| | | | | Change-Id: Icb8151f26bad68795eb2e1f920297267c880b40b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* D3D12: Painter nodeLaszlo Agocs2016-05-031-0/+104
| | | | | | | | | Only supports QImage backing. As a bonus add some notes to the Context2D docs too. Change-Id: I18457a1f766d2f136c6864ec06fe596668d5e726 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Adaptable shader effect enablersLaszlo Agocs2016-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* D3D12: Add support for layersLaszlo Agocs2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Recursive and multisample support is left as a future exercise. Mipmapping is not supported and is not planned for the time being. Layers cannot currently be rendered on their own, although they have their own independent render targets. Starting a layer just starts the next frame early, putting all commands to the normal command list of that frame. Thus this is not yet fully suitable for implementing grabs. Buffer handling is revised to support multiple vertex, index or constant buffers. This is essential since we are going to have multiple renderer instances (and may also be needed for a more complex batching renderer in the future) QSGBasicImageNode::preprocess is changed not to regenerate the geometry on every dynamic texture change. In most cases only the material needs to be dirtied. Rebuilding the geometry is only necessary when the normalized subrect or similar changes. Change-Id: Id088c15d1b75022b54c1f8bff1656d2cd68fa7cc Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Support msaa on the default render targetLaszlo Agocs2016-04-061-0/+6
| | | | | | | | Pick up window->format().samples() and use it. There is nothing that does resolving and extra buffer management for us, do it all manually. Change-Id: I76206574a24dfdd17120433e924a9841c9854904 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Fix Animators with non-GL backendsLaszlo Agocs2016-04-061-0/+18
| | | | | | | Add a test for render thread Animators. Change-Id: Iddb11f734ccec00d76ca99cd8349cbb65750e784 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Text enablersLaszlo Agocs2016-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Enablers for native text rendering. Distance field support is postponed for the time being. The main feature here is the revised texture handling where it is now possible to schedule the update of multiple sub-regions from a list of QImages. BGRA is now used where appropriate, meaning for example that RGB32 needs no QImage conversion anymore. The skeletons of the glyph nodes, the basic text material and the glyph cache are added as well. Also fixes cleanup when closing the window by properly reimplementing invalidate() in the rendercontext. The default rectangle, image and glyph nodes are refactored a bit once again: QSGBasicSomethingNode is now the common (albeit optional), abstract class, living in its own file, whereas QSGDefaultSomethingNode is the GL-specific one, like before. This prepares the future renaming for QSGDefault -> QSGOpenGL. Change-Id: I6dbb4ece10be39fd214bb64082d79607389e3e6e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Basic image supportLaszlo Agocs2016-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | For now there is no mipmapping, no atlases, and all image data is converted to RGBA8888. Regardless, this already makes it possible to use basic Image elements. Follow the same pattern as with rectangles: most of the code is shared via a material-less, abstract QSGDefaultNoMaterialImageNode, with the material-related bits provided by QSGDefaultImageNode for GL and QSGD3D12ImageNode for D3D. Also fixes the harmless but incorrect miscalculation of the VBV size for indexed draws. Image data is copied into an intermediate upload buffer when invoking the render context's createTexture(). The upload is triggered on a separate copy command queue. The main command queue is synchronized via a fence before executing the commands for the current frame. Root signatures are now cached more cleverly and include zero or more SRVs as parameter 1. This involves the engine having to manage a shader (GPU) visible CBV-SRV-UAV descriptor heap as well. Change-Id: I67c35577ff2677e1c7776dd8e5011860e2d78b00 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Revamp logging and add a heavier rectangle testLaszlo Agocs2016-03-041-0/+1
| | | | | | | | Now we can do performance tests since there is no debug output unless requested via QSG_RENDERER_DEBUG. Change-Id: I15ff213f35816401cc113899211b52a98ec30989 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* D3D12: Add support for clipping via scissor and stencilLaszlo Agocs2016-03-041-0/+4
| | | | | Change-Id: Ie55b9a2fd39d9e11321454a34a21c2a52ff1d23a Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Add the skeleton for a D3D12 backendLaszlo Agocs2016-02-191-0/+57
Proof of concept. The plan is to proceed slowly with supporting node types one by one, starting with QSGRectangleNode. Opaque rectangles work already, but only non-smooth for now. The renderer is incomplete (no clip/opacity) and is based on simplerenderer on scenegraph playground. Buffer handling is not necessarily optimal yet. Use QT_QUICK_BACKEND=d3d12 to request this backend. Set QT_D3D_DEBUG=1 to enable the D3D debug layer. The render loop handles everything, incl. swap chain setup, handling resizes, etc. This being D3D, there are no further enablers needed from the QtGui or platform plugin side. By default the first hardware adapter is picked. In the absence of that, WARP is tried. The list of adapters is printed at startup, use QT_D3D_ADAPTER_INDEX to force a given card in case there are multiple ones in the system. The goal is not to productize a fast and great renderer, but to pave the way to better future backends for D3D12 and similar graphics APIs. Compiling in the support into Qt Quick is bad since the dependency onto d3d12.dll is not necessarily acceptable, but it's good enough for now, this being a wip branch. Change-Id: Ifbe088e7507223328096b22eec2c73f77bb5680e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>