diff options
author | Antti Määttä <antti.maatta@qt.io> | 2017-02-02 16:57:02 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2017-03-06 07:48:29 +0000 |
commit | 2b4bfd065ecfa28d8b7399ffed35a2f35834c461 (patch) | |
tree | 879b792dd9f75c25a42d59d5cd9ac99da5477639 /src/quick3d/quick3dscene2d | |
parent | fddaeae702df644c1792a29f1875201e8bd64e94 (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.cpp | 4 |
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, |