Commit Graph

7 Commits

Author SHA1 Message Date
Laszlo Agocs 7b130535cf Implement QSGRenderNode for the rhi path
The documentation is also refined and extended.

Revise the rendernode example as well: make it possible to
test and demonstrate both scissor and stencil based clipping.

An implementation of the triangle for another graphics API
should follow in a separate patch at a later point. For now
only OpenGL is supported in combination with the RHI.

Change-Id: I7ef9f6c6e0b44f1bdf44c9266ea3fa4736367a5d
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-22 16:10:07 +02:00
Kai Koehne ea6cd0de3c Fix outdated BSD license header
Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-10-17 11:18:11 +00:00
Laszlo Agocs 4cb2552313 software: Add support for QSGRenderNode
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>
2016-07-19 10:40:55 +00:00
Laszlo Agocs 446661a199 Enhance rendernode example with opacity support
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>
2016-06-03 10:24:32 +00:00
Laszlo Agocs 1c6d4353f7 One GraphicsInfo to rule them all
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>
2016-06-01 10:32:18 +00:00
Laszlo Agocs 0ea01a229b Use RendererInfo in the rendernode example
Simplifies things a lot.

Change-Id: I57fbedeeb99884aa5b14532c7be33f6373551b5f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-03 10:12:42 +00:00
Laszlo Agocs 28f8795d71 Make rendernode suitable for public consumption
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>
2016-04-20 13:22:19 +00:00