diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 09252cd167..ff87f0407e 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1188,7 +1188,7 @@ bool LLGLManager::initGL() // U32 old_vram = mVRAM; // mVRAM = 0; -#if LL_WINDOWS +#if 0 //LL_WINDOWS Special handling down below if (mHasAMDAssociations) { GLuint gl_gpus_count = wglGetGPUIDsAMD(0, 0); @@ -1249,6 +1249,32 @@ bool LLGLManager::initGL() LL_INFOS("RenderInit") << "VRAM Detected (NVXMemInfo):" << mVRAM << LL_ENDL; } + if (mHasAMDAssociations && mVRAM == 0) + { + GLuint gl_gpus_count = wglGetGPUIDsAMD(0, 0); + if (gl_gpus_count > 0) + { + GLuint* ids = new GLuint[gl_gpus_count]; + wglGetGPUIDsAMD(gl_gpus_count, ids); + + GLuint mem_mb = 0; + for (U32 i = 0; i < gl_gpus_count; i++) + { + wglGetGPUInfoAMD(ids[i], + WGL_GPU_RAM_AMD, + GL_UNSIGNED_INT, + sizeof(GLuint), + &mem_mb); + if (mVRAM < mem_mb) + { + // basically pick the best AMD and trust driver/OS to know to switch + mVRAM = mem_mb; + } + } + } + LL_INFOS("RenderInit") << "VRAM Detected (AMDAssociations):" << mVRAM << LL_ENDL; + } + if (mHasATIMemInfo && mVRAM == 0) { //ask the gl how much vram is free at startup and attempt to use no more than half of that S32 meminfo[4];