Double the maximum texture memory.

This commit is contained in:
Shyotl
2018-01-17 22:55:51 -06:00
parent 2195c2af37
commit a39844f9f3
9 changed files with 34 additions and 34 deletions

View File

@@ -281,7 +281,7 @@ U8* LLImageBase::allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 si
// LLImageRaw
//---------------------------------------------------------------------------
AIThreadSafeSimpleDC<S32> LLImageRaw::sGlobalRawMemory;
AIThreadSafeSimpleDC<S64> LLImageRaw::sGlobalRawMemory;
S32 LLImageRaw::sRawImageCount = 0;
S32 LLImageRaw::sRawImageCachedCount = 0;
@@ -358,7 +358,7 @@ LLImageRaw::~LLImageRaw()
U8* LLImageRaw::allocateData(S32 size)
{
U8* res = LLImageBase::allocateData(size);
*AIAccess<S32>(sGlobalRawMemory) += getDataSize();
*AIAccess<S64>(sGlobalRawMemory) += getDataSize();
return res;
}
@@ -367,7 +367,7 @@ U8* LLImageRaw::reallocateData(S32 size)
{
S32 old_data_size = getDataSize();
U8* res = LLImageBase::reallocateData(size);
*AIAccess<S32>(sGlobalRawMemory) += getDataSize() - old_data_size;
*AIAccess<S64>(sGlobalRawMemory) += getDataSize() - old_data_size;
return res;
}
@@ -375,7 +375,7 @@ U8* LLImageRaw::reallocateData(S32 size)
void LLImageRaw::deleteData()
{
{
*AIAccess<S32>(sGlobalRawMemory) -= getDataSize();
*AIAccess<S64>(sGlobalRawMemory) -= getDataSize();
}
LLImageBase::deleteData();
}
@@ -392,7 +392,7 @@ void LLImageRaw::setDataAndSize(U8 *data, S32 width, S32 height, S8 components)
LLImageBase::setSize(width, height, components) ;
LLImageBase::setDataAndSize(data, width * height * components) ;
*AIAccess<S32>(sGlobalRawMemory) += getDataSize();
*AIAccess<S64>(sGlobalRawMemory) += getDataSize();
}
BOOL LLImageRaw::resize(U16 width, U16 height, S8 components)

View File

@@ -257,7 +257,7 @@ protected:
void setDataAndSize(U8 *data, S32 width, S32 height, S8 components) ;
public:
static AIThreadSafeSimpleDC<S32> sGlobalRawMemory;
static AIThreadSafeSimpleDC<S64> sGlobalRawMemory;
static S32 sRawImageCount;
static S32 sRawImageCachedCount;

View File

@@ -50,9 +50,9 @@ U32 wpo2(U32 i);
U32 LLImageGL::sUniqueCount = 0;
U32 LLImageGL::sBindCount = 0;
S32Bytes LLImageGL::sGlobalTextureMemory(0);
S32Bytes LLImageGL::sBoundTextureMemory(0);
S32Bytes LLImageGL::sCurBoundTextureMemory(0);
S64Bytes LLImageGL::sGlobalTextureMemory(0);
S64Bytes LLImageGL::sBoundTextureMemory(0);
S64Bytes LLImageGL::sCurBoundTextureMemory(0);
S32 LLImageGL::sCount = 0;
BOOL LLImageGL::sGlobalUseAnisotropic = FALSE;
@@ -78,9 +78,9 @@ S32 LLImageGL::sCurTexPickSize = -1 ;
LLPointer<LLImageGL> LLImageGL::sHighlightTexturep = NULL;
S32 LLImageGL::sMaxCategories = 1 ;
std::vector<S32Bytes> LLImageGL::sTextureMemByCategory;
std::vector<S32Bytes> LLImageGL::sTextureMemByCategoryBound ;
std::vector<S32Bytes> LLImageGL::sTextureCurMemByCategoryBound ;
std::vector<S64Bytes> LLImageGL::sTextureMemByCategory;
std::vector<S64Bytes> LLImageGL::sTextureMemByCategoryBound ;
std::vector<S64Bytes> LLImageGL::sTextureCurMemByCategoryBound ;
//------------------------
// ****************************************************************************************************
//End for texture auditing use only
@@ -293,7 +293,7 @@ void LLImageGL::updateStats(F32 current_time)
LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_STATS);
sLastFrameTime = current_time;
sBoundTextureMemory = sCurBoundTextureMemory;
sCurBoundTextureMemory = S32Bytes(0);
sCurBoundTextureMemory = S64Bytes(0);
if(gAuditTexture)
{
@@ -305,7 +305,7 @@ void LLImageGL::updateStats(F32 current_time)
for(U32 i = 0 ; i < sTextureCurMemByCategoryBound.size() ; i++)
{
sTextureMemByCategoryBound[i] = sTextureCurMemByCategoryBound[i] ;
sTextureCurMemByCategoryBound[i] = (S32Bytes)0 ;
sTextureCurMemByCategoryBound[i] = (S64Bytes)0 ;
}
}
}

View File

@@ -233,9 +233,9 @@ public:
static F32 sLastFrameTime;
// Global memory statistics
static S32Bytes sGlobalTextureMemory; // Tracks main memory texmem
static S32Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
static S32Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
static S64Bytes sGlobalTextureMemory; // Tracks main memory texmem
static S64Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
static S64Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
static U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
static BOOL sGlobalUseAnisotropic;
@@ -288,9 +288,9 @@ public:
//for debug use: show texture category distribution
//----------------------------------------
static std::vector<S32Bytes> sTextureMemByCategory;
static std::vector<S32Bytes> sTextureMemByCategoryBound ;
static std::vector<S32Bytes> sTextureCurMemByCategoryBound ;
static std::vector<S64Bytes> sTextureMemByCategory;
static std::vector<S64Bytes> sTextureMemByCategoryBound ;
static std::vector<S64Bytes> sTextureCurMemByCategoryBound ;
//----------------------------------------
// ****************************************************************************************************
//End of definitions for texture auditing use only

View File

@@ -583,11 +583,11 @@ void LLGLTexMemBar::draw()
std::string text = "";
S32 global_raw_memory;
S64 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
global_raw_memory = *AIAccess<S64>(LLImageRaw::sGlobalRawMemory);
}
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %lld MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d",
total_mem.value(),
max_total_mem.value(),
bound_mem.value(),

View File

@@ -444,9 +444,9 @@ void reset_statistics()
void output_statistics(void*)
{
S32 global_raw_memory;
S64 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
global_raw_memory = *AIAccess<S64>(LLImageRaw::sGlobalRawMemory);
}
LL_INFOS() << "Number of orphans: " << gObjectList.getOrphanCount() << LL_ENDL;
LL_INFOS() << "Number of dead objects: " << gObjectList.mNumDeadObjects << LL_ENDL;

View File

@@ -65,7 +65,7 @@
// extern
const S32Megabytes gMinVideoRam(32);
const S32Megabytes gMaxVideoRam(1024);
const S32Megabytes gMaxVideoRam(2048);
// statics
@@ -88,11 +88,11 @@ S32 LLViewerTexture::sAuxCount = 0;
LLFrameTimer LLViewerTexture::sEvaluationTimer;
F32 LLViewerTexture::sDesiredDiscardBias = 0.f;
F32 LLViewerTexture::sDesiredDiscardScale = 1.1f;
S32Bytes LLViewerTexture::sBoundTextureMemory;
S32Bytes LLViewerTexture::sTotalTextureMemory;
S64Bytes LLViewerTexture::sBoundTextureMemory;
S64Bytes LLViewerTexture::sTotalTextureMemory;
S32Megabytes LLViewerTexture::sMaxBoundTextureMemory;
S32Megabytes LLViewerTexture::sMaxTotalTextureMem;
S32Bytes LLViewerTexture::sMaxDesiredTextureMem;
S64Bytes LLViewerTexture::sMaxDesiredTextureMem;
S8 LLViewerTexture::sCameraMovingDiscardBias = 0;
F32 LLViewerTexture::sCameraMovingBias = 0.0f ;
S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size

View File

@@ -218,11 +218,11 @@ public:
static LLFrameTimer sEvaluationTimer;
static F32 sDesiredDiscardBias;
static F32 sDesiredDiscardScale;
static S32Bytes sBoundTextureMemory;
static S32Bytes sTotalTextureMemory;
static S64Bytes sBoundTextureMemory;
static S64Bytes sTotalTextureMemory;
static S32Megabytes sMaxBoundTextureMemory;
static S32Megabytes sMaxTotalTextureMem;
static S32Bytes sMaxDesiredTextureMem ;
static S64Bytes sMaxDesiredTextureMem ;
static S8 sCameraMovingDiscardBias;
static F32 sCameraMovingBias;
static S32 sMaxSculptRez ;

View File

@@ -746,9 +746,9 @@ void LLViewerTextureList::updateImages(F32 max_time)
}
cleared = FALSE;
S32 global_raw_memory;
S64 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
global_raw_memory = *AIAccess<S64>(LLImageRaw::sGlobalRawMemory);
}
LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages);
LLViewerStats::getInstance()->mNumRawImagesStat.addValue(LLImageRaw::sRawImageCount);