aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-04-13 12:33:00 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-04-20 13:22:19 +0000
commit28f8795d716035516f03542cd55275375462fdc5 (patch)
treedd8afa6ae6b86e8867ca0af7543e3fd6ba24f942 /src/quick/scenegraph/qsgcontext.cpp
parent40f1aa2d06e8217abb36f29d2a5a9189beab0826 (diff)
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>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index b0dd24af23..0f0a7be3b2 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -296,6 +296,13 @@ QSize QSGContext::minimumFBOSize() const
return QSize(1, 1);
}
+QSGRendererInterface *QSGContext::rendererInterface(QSGRenderContext *renderContext)
+{
+ Q_UNUSED(renderContext);
+ qWarning("QSGRendererInterface not implemented");
+ return nullptr;
+}
+
QSGRenderContext::QSGRenderContext(QSGContext *context)
: m_sg(context)
, m_distanceFieldCacheManager(0)