Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion indra/newview/lldrawpoolbump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ static S32 cube_channel = -1;
static S32 diffuse_channel = -1;
static S32 bump_channel = -1;

#define LL_BUMPLIST_MULTITHREADED 0 // TODO -- figure out why this doesn't work
// Enabled after changing LLViewerTexture::mNeedsCreateTexture to an
// LLAtomicBool; this should work just fine, now. HB
#define LL_BUMPLIST_MULTITHREADED 1

// static
void LLStandardBumpmap::init()
Expand Down
16 changes: 8 additions & 8 deletions indra/newview/llviewertexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
mLoadedCallbackDesiredDiscardLevel = S8_MAX;
mPauseLoadedCallBacks = FALSE;

mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;

mIsRawImageValid = FALSE;
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
Expand Down Expand Up @@ -1400,12 +1400,12 @@ void LLViewerFetchedTexture::addToCreateTexture()
{
//just update some variables, not to create a real GL texture.
createGLTexture(mRawDiscardLevel, mRawImage, 0, FALSE);
mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;
destroyRawImage();
}
else if(!force_update && getDiscardLevel() > -1 && getDiscardLevel() <= mRawDiscardLevel)
{
mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;
destroyRawImage();
}
else
Expand Down Expand Up @@ -1441,7 +1441,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
mRawDiscardLevel += i;
if(mRawDiscardLevel >= getDiscardLevel() && getDiscardLevel() > 0)
{
mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;
destroyRawImage();
return;
}
Expand Down Expand Up @@ -1473,7 +1473,7 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
destroyRawImage();
return FALSE;
}
mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;

if (mRawImage.isNull())
{
Expand Down Expand Up @@ -1609,14 +1609,14 @@ void LLViewerFetchedTexture::postCreateTexture()
destroyRawImage();
}

mNeedsCreateTexture = FALSE;
mNeedsCreateTexture = false;
}

void LLViewerFetchedTexture::scheduleCreateTexture()
{
if (!mNeedsCreateTexture)
{
mNeedsCreateTexture = TRUE;
mNeedsCreateTexture = true;
if (preCreateTexture())
{
#if LL_IMAGEGL_THREAD_CHECK
Expand All @@ -1630,7 +1630,7 @@ void LLViewerFetchedTexture::scheduleCreateTexture()
memcpy(data_copy, data, size);
}
#endif
mNeedsCreateTexture = TRUE;
mNeedsCreateTexture = true;
auto mainq = LLImageGLThread::sEnabled ? mMainQueue.lock() : nullptr;
if (mainq)
{
Expand Down
5 changes: 4 additions & 1 deletion indra/newview/llviewertexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#ifndef LL_LLVIEWERTEXTURE_H
#define LL_LLVIEWERTEXTURE_H

#include "llatomic.h"
#include "llgltexture.h"
#include "lltimer.h"
#include "llframetimer.h"
Expand Down Expand Up @@ -528,7 +529,9 @@ class LLViewerFetchedTexture : public LLViewerTexture
LLFrameTimer mStopFetchingTimer; // Time since mDecodePriority == 0.f.

BOOL mInImageList; // TRUE if image is in list (in which case don't reset priority!)
BOOL mNeedsCreateTexture;
// This needs to be atomic, since it is written both in the main thread
// and in the GL image worker thread... HB
LLAtomicBool mNeedsCreateTexture;

BOOL mForSculpt ; //a flag if the texture is used as sculpt data.
BOOL mIsFetched ; //is loaded from remote or from cache, not generated locally.
Expand Down