aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/rendernode/d3d12renderer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rendernode example: do not rely on build-time shader compilationLaszlo Agocs2016-11-221-7/+18
| | | | | | | | | | | | There is no public intrastructure for this. Relying on the internal qmake rule in qtdeclarative is wrong as it is not meant for public consumption and is not available in out of tree examples in the installed Qt anyway. Instead, ship the bytecode for now. Task-number: QTBUG-56327 Change-Id: I19327aa880ad573560d1e9376f36c67aa509b51a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QSGRendererInterface: Add Resource suffix for consistencyLaszlo Agocs2016-11-181-2/+3
| | | | | Change-Id: I60e674760725d4c4dd13f53b31c3abb6b09c1790 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use d3d12 feature in rendernode exampleLaszlo Agocs2016-10-111-2/+2
| | | | | | | | Migrate the example away from config_d3d12 and make the feature public. Task-number: QTBUG-56327 Change-Id: I88809b8c41282cd75952d085cfd539a5d80f3f38 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add optional flags and rect to QSGRenderNodeLaszlo Agocs2016-08-021-0/+10
| | | | | | | | | | | | Having rendernodes triggering fullscreen updates with the software backend is not ideal. Therefore, introduce the option of reporting that the rendernode is well-behaving, meaning it only writes inside the reported bounding rectangle. Similarly, the OpenGL batch renderer can keep using the depth buffer when the rendernode is known to behave like the renderer expects. Change-Id: I6acc434432c2504776f26e8917b5434b44be293d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* software: Add support for QSGRenderNodeLaszlo Agocs2016-07-191-2/+2
| | | | | | | | | | | | | | | | | 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: Fix the rendernode example for multisamplingLaszlo Agocs2016-07-011-1/+14
| | | | | | | Show how this can be handled in the custom QSGRenderNode implementation. Change-Id: Id6f18ca568a4850060f957998532815bce5c4ac5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Enhance rendernode example with opacity supportLaszlo Agocs2016-06-031-13/+29
| | | | | | | | The opacity is already animated in the QML scene but enabling blending and using inheritedOpacity() was not done. Until now. Change-Id: Iaaf50c20302e29db85c5dfaeaab4d069cb18714e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Refactor the rendernode exampleLaszlo Agocs2016-05-311-15/+30
| | | | | | | | By removing the Renderer abstraction it becomes easier to follow and understand. Change-Id: Iddacb461d51a75864983850660c5480985b3524f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make rendernode suitable for public consumptionLaszlo Agocs2016-04-201-0/+229
For non-OpenGL APIs the primary (and likely the only) way to add custom rendering into the Qt Quick scene is via the render node. Other approaches,like the before/afterRendering signals, QQuickFramebufferObject, remain OpenGL-only. (although QQuickFramebufferObject may get a multi-API replacement based on QSGRenderNode at a later time) Note that this is not a generic 3D content integration enabler. It targets creating 2D and 2.5D Quick items with custom rendering via the graphics API in use. Make QSGRenderNode public, enhance the docs a bit and add a releaseResources(). Add a QSGRendererInterface with a query function in QQuickWindow and QSGEngine. The scenegraph adaptation can then return a custom implementation of the interface. This will be necessary to query API-specific values, f.ex. the ID3D12Device and ID3D12CommandList when running with the d3d12 backend. The interface allows querying the API and void* resources. Resources that we know about in advance are enum-based to prevent the QPlatformNativeInterface-like ugliness of string keys. Support is there in the batch renderer already, fix this up according to the new public API, and implement the corresponding bits for the D3D12 renderer. For D3D12, fix also an issue with QSGNode destruction where graphics resources in use were attempted to be final-released without a proper wait. The semantics of changedStates() in QSGRenderNode is changed so that it can be called at any time, including before render(). This is very useful since we can implement some state restoring in a more efficient manner. Added a new example as well. Documentation for QSGRenderNode is heavily expanded. Change-Id: I4c4a261c55791d0e38743a784bc4c05a53b3462d Reviewed-by: Andy Nichols <andy.nichols@qt.io>