From 682ddcd7187b16723af66d7f9c1b61bc060f44c1 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 10 Apr 2014 17:32:36 +0200 Subject: 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 --- src/core/delegated_frame_node.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/delegated_frame_node.h') 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 #include +#include "chromium_gpu_helper.h" + QT_BEGIN_NAMESPACE class QSGRenderContext; QT_END_NAMESPACE @@ -83,6 +85,7 @@ private: QSGRenderContext *m_sgRenderContext; QList > m_renderPassTextures; int m_numPendingSyncPoints; + FenceSync m_mailboxesGLFence; QWaitCondition m_mailboxesFetchedWaitCond; QMutex m_mutex; -- cgit v1.2.3