summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorRunitai Linden <davep@lindenlab.com>2021-11-22 19:12:39 -0600
committerRunitai Linden <davep@lindenlab.com>2021-11-22 19:12:39 -0600
commit744646eb71fd9d1d1161ae1132bfe8a9a2c7dd9d (patch)
tree879be3c2936c350072065d0c76090b1127b81a8e /indra/llrender
parent9b0d8c7e629597fd8e6dfb91a6b8f625b34ab274 (diff)
SL-16400 Fix for grey textures (hack).
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp4
-rw-r--r--indra/llrender/llimagegl.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index e623baa653..eda61d3c74 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -2268,6 +2268,10 @@ 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;
};