Update texturelist/volumetexture management with changes from upstream. Note: TEX_LIST_SCALE not utilized in singu... yet.

This commit is contained in:
Shyotl
2019-10-19 04:05:34 -05:00
parent 835083a741
commit 4043130f75
17 changed files with 379 additions and 187 deletions

View File

@@ -61,11 +61,12 @@ class LLMessageSystem;
class LLViewerMediaImpl ;
class LLVOVolume ;
class LLFace ; //But llface.h is already included...(?)
struct LLTextureKey;
class LLLoadedCallbackEntry
{
public:
typedef std::set< LLUUID > source_callback_list_t;
typedef std::set< LLTextureKey > source_callback_list_t;
public:
LLLoadedCallbackEntry(loaded_callback_func cb,
@@ -138,6 +139,8 @@ public:
void setID(const LLUUID& id) { mID = id; } // Edit for local assets to cut down on reloads, be sure to remove from wherever this has been added first.
void setBoostLevel(S32 level);
S32 getBoostLevel() { return mBoostLevel; }
void setTextureListType(S32 tex_type) { mTextureListType = tex_type; }
S32 getTextureListType() { return mTextureListType; }
void addTextureStats(F32 virtual_size, BOOL needs_gltexture = TRUE) const;
void resetTextureStats();
@@ -159,10 +162,10 @@ public:
S32 getNumFaces(U32 ch) const;
const ll_face_list_t* getFaceList(U32 channel) const {llassert(channel < LLRender::NUM_TEXTURE_CHANNELS); return &mFaceList[channel];}
virtual void addVolume(LLVOVolume* volumep);
virtual void removeVolume(LLVOVolume* volumep);
S32 getNumVolumes() const;
const ll_volume_list_t* getVolumeList() const { return &mVolumeList; }
virtual void addVolume(U32 channel, LLVOVolume* volumep);
virtual void removeVolume(U32 channel, LLVOVolume* volumep);
S32 getNumVolumes(U32 channel) const;
const ll_volume_list_t* getVolumeList(U32 channel) const { return &mVolumeList[channel]; }
virtual void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ;
@@ -192,6 +195,8 @@ private:
static bool isMemoryForTextureLow() ;
protected:
LLUUID mID;
S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList
F32 mSelectedTime; // time texture was last selected
mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need?
mutable S32 mMaxVirtualSizeResetCounter ;
@@ -203,8 +208,8 @@ protected:
U32 mNumFaces[LLRender::NUM_TEXTURE_CHANNELS];
LLFrameTimer mLastFaceListUpdateTimer ;
ll_volume_list_t mVolumeList;
U32 mNumVolumes;
ll_volume_list_t mVolumeList[LLRender::NUM_VOLUME_TEXTURE_CHANNELS];
U32 mNumVolumes[LLRender::NUM_VOLUME_TEXTURE_CHANNELS];
LLFrameTimer mLastVolumeListUpdateTimer;
//do not use LLPointer here.
@@ -636,8 +641,9 @@ public:
//
//"find-texture" just check if the texture exists, if yes, return it, otherwise return null.
//
static LLViewerTexture* findTexture(const LLUUID& id) ;
static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id) ;
static void findFetchedTextures(const LLUUID& id, std::vector<LLViewerFetchedTexture*> &output);
static void findTextures(const LLUUID& id, std::vector<LLViewerTexture*> &output);
static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id, S32 tex_type);
static LLViewerMediaTexture* findMediaTexture(const LLUUID& id) ;
static LLViewerMediaTexture* createMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ;
@@ -720,18 +726,18 @@ private:
private:
BOOL mUsingDefaultTexture; //if set, some textures are still gray.
U32 mTotalBytesUsed ; //total bytes of textures bound/used for the current frame.
U32 mTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the current frame for images larger than 256 * 256.
U32 mLastTotalBytesUsed ; //total bytes of textures bound/used for the previous frame.
U32 mLastTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the previous frame for images larger than 256 * 256.
U32Bytes mTotalBytesUsed ; //total bytes of textures bound/used for the current frame.
U32Bytes mTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the current frame for images larger than 256 * 256.
U32Bytes mLastTotalBytesUsed ; //total bytes of textures bound/used for the previous frame.
U32Bytes mLastTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the previous frame for images larger than 256 * 256.
//
//data size
//
U32 mTotalBytesLoaded ; //total bytes fetched by texture pipeline
U32 mTotalBytesLoadedFromCache ; //total bytes fetched by texture pipeline from local cache
U32 mTotalBytesLoadedForLargeImage ; //total bytes fetched by texture pipeline for images larger than 256 * 256.
U32 mTotalBytesLoadedForSculpties ; //total bytes fetched by texture pipeline for sculpties
U32Bytes mTotalBytesLoaded ; //total bytes fetched by texture pipeline
U32Bytes mTotalBytesLoadedFromCache ; //total bytes fetched by texture pipeline from local cache
U32Bytes mTotalBytesLoadedForLargeImage ; //total bytes fetched by texture pipeline for images larger than 256 * 256.
U32Bytes mTotalBytesLoadedForSculpties ; //total bytes fetched by texture pipeline for sculpties
//
//time