From e194fc39f460f9807df463ebb87ddb35eaef33b4 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 6 Apr 2016 11:29:03 -0700 Subject: [PATCH] Move the texture transfer context back to the main thread for shutdown --- libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp | 6 ++++++ libraries/gpu/src/gpu/GLBackendTextureTransfer.h | 1 + 2 files changed, 7 insertions(+) diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp index 2610d9bc4a..907bc6a538 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp @@ -77,6 +77,12 @@ void GLTextureTransferHelper::setup() { #endif } +void GLTextureTransferHelper::shutdown() { + _canvas->doneCurrent(); + _canvas->moveToThreadWithContext(qApp->thread()); +} + + bool GLTextureTransferHelper::processQueueItems(const Queue& messages) { for (auto package : messages) { glWaitSync(package.fence, 0, GL_TIMEOUT_IGNORED); diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h index 3a147defdf..1e850586d4 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h @@ -28,6 +28,7 @@ public: protected: void setup() override; + void shutdown() override; bool processQueueItems(const Queue& messages) override; void transferTextureSynchronous(const gpu::Texture& texture);