summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3dscene2d
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2017-02-02 16:57:02 +0200
committerAntti Määttä <antti.maatta@qt.io>2017-03-06 07:48:29 +0000
commit2b4bfd065ecfa28d8b7399ffed35a2f35834c461 (patch)
tree879b792dd9f75c25a42d59d5cd9ac99da5477639 /src/quick3d/quick3dscene2d
parentfddaeae702df644c1792a29f1875201e8bd64e94 (diff)
Fix crash in scene2d when using angle
Angle can't do multithreaded rendering on shared context so it needs to synchronize the rendering with qt3d render thread. The SurfaceLocker uses static mutex, so using it to lock the surface will prevent simulatious rendering as well. Flag the surface lock for angle build only. Change-Id: I83d4e1f1d6a48e86196bc113cbab4ee79205b61f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3dscene2d')
-rw-r--r--src/quick3d/quick3dscene2d/items/scene2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick3d/quick3dscene2d/items/scene2d.cpp b/src/quick3d/quick3dscene2d/items/scene2d.cpp
index 0ecb49ab3..88bbb4e94 100644
--- a/src/quick3d/quick3dscene2d/items/scene2d.cpp
+++ b/src/quick3d/quick3dscene2d/items/scene2d.cpp
@@ -57,6 +57,7 @@
#include <private/qbackendnode_p.h>
#include <private/qpickevent_p.h>
#include <private/entity_p.h>
+#include <private/platformsurfacefilter_p.h>
QT_BEGIN_NAMESPACE
@@ -326,6 +327,9 @@ void Scene2D::render()
const Qt3DRender::Render::Attachment *attachmentData = nullptr;
QMutex *textureLock = nullptr;
+#ifdef QT_OPENGL_ES_2_ANGLE
+ SurfaceLocker surfaceLocker(m_sharedObject->m_surface);
+#endif
m_context->makeCurrent(m_sharedObject->m_surface);
if (resourceAccessor()->accessResource(RenderBackendResourceAccessor::OutputAttachment,