diff options
author | Dave Parks <davep@lindenlab.com> | 2022-02-17 22:52:23 +0000 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-02-17 22:52:23 +0000 |
commit | 0d6aa3c0fe184ae00899304cb3f71315f5c73314 (patch) | |
tree | 88196dfd88c70728132cd05b5b7d5d4e630dd50a /indra/newview/llviewertexture.cpp | |
parent | 892f7d98d5da2c329472a7075a88e010277b86b0 (diff) |
SL-16815 Remove frame stalls from occlusion queries, bumpmap updates, and querying for available video memory.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5fed46f437..fa2c070ea0 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -515,9 +515,10 @@ void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &p { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; static LLFrameTimer timer; + static S32Megabytes gpu_res = S32Megabytes(S32_MAX); static S32Megabytes physical_res = S32Megabytes(S32_MAX); - + if (timer.getElapsedTimeF32() < GPU_MEMORY_CHECK_WAIT_TIME) //call this once per second. { gpu = gpu_res; @@ -527,22 +528,11 @@ void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &p timer.reset(); { - if (gGLManager.mHasATIMemInfo) - { - S32 meminfo[4]; - glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); - gpu_res = (S32Megabytes)meminfo[0]; - - //check main memory, only works for windows. - LLMemory::updateMemoryInfo(); - physical_res = LLMemory::getAvailableMemKB(); - } - else if (gGLManager.mHasNVXMemInfo) - { - S32 free_memory; - glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory); - gpu_res = (S32Megabytes)(free_memory / 1024); - } + gpu_res = (S32Megabytes) LLImageGLThread::getFreeVRAMMegabytes(); + + //check main memory, only works for windows. + LLMemory::updateMemoryInfo(); + physical_res = LLMemory::getAvailableMemKB(); gpu = gpu_res; physical = physical_res; |