diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-23 15:41:46 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-23 15:41:46 -0500 |
commit | 6d36038e4098ebe7334284fc9b3fb76bc116c106 (patch) | |
tree | 18c7949f018a87bb354f6a50d32d38829e177635 /indra/llrender | |
parent | 37900e593d65e93913774f118a9aa461eeb8ef58 (diff) | |
parent | 744646eb71fd9d1d1161ae1132bfe8a9a2c7dd9d (diff) |
Merge branch 'glthread' of ssh://bitbucket.org/lindenlab/viewer into glthreadx
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 6 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 1b6920fe3b..eda61d3c74 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2257,6 +2257,7 @@ LLImageGLThread::LLImageGLThread(LLWindow* window) : ThreadPool("LLImageGL", 1, 1024*1024) , mWindow(window) { + LL_PROFILE_ZONE_SCOPED; mFinished = false; mContext = mWindow->createSharedContext(); @@ -2264,8 +2265,13 @@ LLImageGLThread::LLImageGLThread(LLWindow* window) void LLImageGLThread::run() { + LL_PROFILE_ZONE_SCOPED; // We must perform setup on this thread before actually servicing our // WorkQueue, likewise cleanup afterwards. + while (mContext == nullptr) + { // HACK -- wait for mContext to be initialized since this thread will usually start before mContext is set + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } mWindow->makeContextCurrent(mContext); gGL.init(); ThreadPool::run(); diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 27496def1d..ae773bb362 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -324,7 +324,7 @@ public: private: LLWindow* mWindow; - void* mContext; + void* mContext = nullptr; LLAtomicBool mFinished; }; |