diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-12-12 15:31:32 +0000 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-12-14 11:18:19 +0000 |
commit | 412f9985bd59b1c46407eda67b963cbdbdc48e4b (patch) | |
tree | 1915f46702bfb7b44cb52485c5d02363f375b927 /src/render/backend/renderer_p.h | |
parent | f3e9952fb03050fd30fc0618f520bcdbdbfc45d2 (diff) |
Ensure offscreen surface used during cleanup is created on gui thread
Windows uses a QWindow to back QOffscreenSurface so we must needs
create it on the gui thread. To complicate matters we don't know the
format used by Qt 3D until the Renderer is initialized. So we have to
defer creation of the offscreen surface until that time and do it in
the gui thread with the correct format.
Task-number: QTBUG-57496
Change-Id: Idaad23c2229ab069f3e02c8d075be8e6718a8a50
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/backend/renderer_p.h')
-rw-r--r-- | src/render/backend/renderer_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/render/backend/renderer_p.h b/src/render/backend/renderer_p.h index ad86fc3ce..da5421d6c 100644 --- a/src/render/backend/renderer_p.h +++ b/src/render/backend/renderer_p.h @@ -232,6 +232,8 @@ public: bool isReadyToSubmit(); QVariant executeCommand(const QStringList &args) Q_DECL_OVERRIDE; + void setOffscreenSurfaceHelper(OffscreenSurfaceHelper *helper) Q_DECL_OVERRIDE; + QSurfaceFormat format() Q_DECL_OVERRIDE; struct ViewSubmissionResultData { @@ -270,6 +272,7 @@ private: ShaderParameterPack m_defaultUniformPack; QScopedPointer<GraphicsContext> m_graphicsContext; + QSurfaceFormat m_format; RenderQueue *m_renderQueue; QScopedPointer<RenderThread> m_renderThread; @@ -328,6 +331,9 @@ private: bool m_ownedContext; + OffscreenSurfaceHelper *m_offscreenHelper; + QMutex m_offscreenSurfaceMutex; + #ifdef QT3D_JOBS_RUN_STATS QScopedPointer<Qt3DRender::Debug::CommandExecuter> m_commandExecuter; friend class Qt3DRender::Debug::CommandExecuter; |