summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-11-23 21:23:45 -0500
committerNat Goodspeed <nat@lindenlab.com>2021-11-23 21:23:45 -0500
commitd71e0a6d4778d4c67b8793ba569fee2db226bc8e (patch)
treedce713230aa611dbada3c6f78903d988b1ae06a4 /indra/newview/llviewertexture.cpp
parent67ace0df9953ce3264048c3946720a9df492edfa (diff)
parent8852cb9cbd25df8d25fa43cf39b222ab8381ebd6 (diff)
SL-16094, SL-16400: Merge branch 'DRTVWR-546' into glthread
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 498e4ef8bc..e6ac701644 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -679,9 +679,6 @@ 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
@@ -1625,26 +1622,17 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
{
mNeedsCreateTexture = TRUE;
#if LL_WINDOWS //flip to 0 to revert to single-threaded OpenGL texture uploads
- 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
+ if (!LLImageGLThread::sInstance->post([this]()
+ {
+ //actually create the texture on a background thread
+ createTexture();
+ LLImageGLThread::sInstance->postCallback([this]()
+ {
+ //finalize on main thread
+ postCreateTexture();
+ unref();
+ });
+ }))
#endif
{
gTextureList.mCreateTextureList.insert(this);
@@ -3598,11 +3586,22 @@ BOOL LLViewerMediaTexture::findFaces()
for(; iter != obj_list->end(); ++iter)
{
LLVOVolume* obj = *iter;
- if(obj->mDrawable.isNull())
- {
- ret = FALSE;
- continue;
- }
+ if (obj->isDead())
+ {
+ // Isn't supposed to happen, objects are supposed to detach
+ // themselves on markDead()
+ // If this happens, viewer is likely to crash
+ llassert(0);
+ LL_WARNS() << "Dead object in mMediaImplp's object list" << LL_ENDL;
+ ret = FALSE;
+ continue;
+ }
+
+ if (obj->mDrawable.isNull() || obj->mDrawable->isDead())
+ {
+ ret = FALSE;
+ continue;
+ }
S32 face_id = -1;
S32 num_faces = obj->mDrawable->getNumFaces();