path: root/src/core/delegated_frame_node.h
diff options
authorJocelyn Turcotte <>2014-04-10 17:32:36 +0200
committerThe Qt Project <>2014-04-10 21:03:22 +0200
commit682ddcd7187b16723af66d7f9c1b61bc060f44c1 (patch)
treeda181af0cbb3656a95c6b3c3b0708d6fda91a369 /src/core/delegated_frame_node.h
parentf61493ee97f285e4b7257f7590f45764980ca52e (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 <> Reviewed-by: Zeno Albisser <>
Diffstat (limited to 'src/core/delegated_frame_node.h')
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"
class QSGRenderContext;
@@ -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;