summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-08-30 10:46:36 -0500
committerDave Parks <davep@lindenlab.com>2022-08-30 10:46:36 -0500
commit197ac7cc2048fe4c259858f48946cd954782dfc2 (patch)
treed838e4708ede7d910680b00932b5777d5967838a /indra/llrender/llimagegl.h
parent302bf29242ef1acd6ef984d78c918a6f4b092a0a (diff)
parent14af7cabdb80e1de0f5cb2c7e299bd61bc3321cc (diff)
Merge remote-tracking branch 'remotes/origin/DRTVWR-563' into DRTVWR-559
Diffstat (limited to 'indra/llrender/llimagegl.h')
-rw-r--r--indra/llrender/llimagegl.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index b419c9fab5..b4618fd35c 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -52,6 +52,13 @@ class LLImageGL : public LLRefCount
{
friend class LLTexUnit;
public:
+
+ // Get an estimate of how many bytes have been allocated in vram for textures.
+ // Does not include mipmaps.
+ // NOTE: multiplying this number by two gives a good estimate for total
+ // video memory usage based on testing in lagland against an NVIDIA GPU.
+ static U64 getTextureBytesAllocated();
+
// These 2 functions replace glGenTextures() and glDeleteTextures()
static void generateTextures(S32 numTextures, U32 *textures);
static void deleteTextures(S32 numTextures, const U32 *textures);
@@ -61,7 +68,7 @@ public:
static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height);
static S32 dataFormatComponents(S32 dataformat);
- BOOL updateBindStats(S32Bytes tex_mem) const ;
+ BOOL updateBindStats() const ;
F32 getTimePassedSinceLastBound();
void forceUpdateBindStats(void) const;
@@ -73,9 +80,6 @@ public:
static void restoreGL();
static void dirtyTexOptions();
- // Sometimes called externally for textures not using LLImageGL (should go away...)
- static S32 updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category) ;
-
static bool checkSize(S32 width, S32 height);
//for server side use only.
@@ -165,7 +169,7 @@ public:
void updatePickMask(S32 width, S32 height, const U8* data_in);
BOOL getMask(const LLVector2 &tc);
- void checkTexSize(bool forced = false) const ;
+ void checkTexSize(bool forced = false) const ;
// Sets the addressing mode used to sample the texture
// (such as wrapping, mirrored wrapping, and clamp)
@@ -265,9 +269,6 @@ 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 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;
@@ -327,12 +328,6 @@ public:
// follows gSavedSettings "RenderGLMultiThreaded"
static bool sEnabled;
- // app should call this function periodically
- static void updateClass();
-
- // free video memory in megabytes
- static std::atomic<S32> sFreeVRAMMegabytes;
-
LLImageGLThread(LLWindow* window);
// post a function to be executed on the LLImageGL background thread
@@ -344,8 +339,6 @@ public:
void run() override;
- static S32 getFreeVRAMMegabytes();
-
private:
LLWindow* mWindow;
void* mContext = nullptr;