summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-11-24 10:47:54 -0500
committerNat Goodspeed <nat@lindenlab.com>2021-11-24 10:47:54 -0500
commit0b066539fe68dc5750900c3452189645c40adb45 (patch)
treefd01b6eaf174f7744fd82a28b0b948d301fd4d2b /indra/newview/llviewertexture.cpp
parent78d837789a3741c65c3334934d96a505a522ee43 (diff)
DRTVWR-546, SL-16220, SL-16094: Undo previous glthread branch revert.
Reverting a merge is sticky: it tells git you never want to see that branch again. Merging the DRTVWR-546 branch, which contained the revert, into the glthread branch undid much of the development work on that branch. To restore it we must revert the revert. This reverts commit 029b41c0419e975bbb28454538b46dc69ce5d2ba.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index e6ac701644..f932acd48c 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -679,6 +679,9 @@ void LLViewerTexture::init(bool firstinit)
mVolumeList[LLRender::LIGHT_TEX].clear();
mVolumeList[LLRender::SCULPT_TEX].clear();
+
+ mMainQueue = LL::WorkQueue::getInstance("mainloop");
+ mImageQueue = LL::WorkQueue::getInstance("LLImageGL");
}
//virtual
@@ -1622,17 +1625,26 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
{
mNeedsCreateTexture = TRUE;
#if LL_WINDOWS //flip to 0 to revert to single-threaded OpenGL texture uploads
- if (!LLImageGLThread::sInstance->post([this]()
- {
- //actually create the texture on a background thread
- createTexture();
- LLImageGLThread::sInstance->postCallback([this]()
- {
- //finalize on main thread
- postCreateTexture();
- unref();
- });
- }))
+ auto mainq = mMainQueue.lock();
+ if (mainq)
+ {
+ mainq->postTo(
+ mImageQueue,
+ // work to be done on LLImageGL worker thread
+ [this]()
+ {
+ //actually create the texture on a background thread
+ createTexture();
+ },
+ // callback to be run on main thread
+ [this]()
+ {
+ //finalize on main thread
+ postCreateTexture();
+ unref();
+ });
+ }
+ else
#endif
{
gTextureList.mCreateTextureList.insert(this);