diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-04-10 17:32:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-10 21:03:22 +0200 |
commit | 682ddcd7187b16723af66d7f9c1b61bc060f44c1 (patch) | |
tree | da181af0cbb3656a95c6b3c3b0708d6fda91a369 /src/core/delegated_frame_node.h | |
parent | f61493ee97f285e4b7257f7590f45764980ca52e (diff) |
Use a fence sync to synchronize GL between threads
The NVidia driver needs more than a glFlush to ensure that GL commands
consuming Chromium resources are run only when the resource is completely
produced by the Chromium GPU thread.
This produces artifacts and an uneven frame rate in WebGL examples
on this kind of hardware.
Use the same mechanism as used by gfx::GLFence, doing a few things
manually to cope with the fact that Chromium and Qt both have their
own GL function table and contexts.
Change-Id: I33eeb1068994dc4176038a74579ce768b2bccb9d
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'src/core/delegated_frame_node.h')
-rw-r--r-- | src/core/delegated_frame_node.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index 214894821..a42e293a5 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -50,6 +50,8 @@ #include <QSharedPointer> #include <QWaitCondition> +#include "chromium_gpu_helper.h" + QT_BEGIN_NAMESPACE class QSGRenderContext; QT_END_NAMESPACE @@ -83,6 +85,7 @@ private: QSGRenderContext *m_sgRenderContext; QList<QSharedPointer<RenderPassTexture> > m_renderPassTextures; int m_numPendingSyncPoints; + FenceSync m_mailboxesGLFence; QWaitCondition m_mailboxesFetchedWaitCond; QMutex m_mutex; |