diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6b22b0dd96..baea084955 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1158,6 +1158,26 @@ bool LLAppViewer::init() // Early out from user choice. return false; } + + // Texture memory management + // On 64bit builds, allow up to 1GB texture memory on cards with 2GB video + // memory and up to 2GB texture memory on cards with 4GB video memory. Check + // is performed against a lower limit as not exactly 2 or 4GB might not be + // returned. +#ifdef ND_BUILD64BIT_ARCH + if (gGLManager.mVRAM > 3584) + { + gMaxVideoRam = S32Megabytes(2048); + LL_INFOS() << "At least 4 GB video memory detected - increasing max video ram to " << gMaxVideoRam.value() << " MB" << LL_ENDL; + } + else if (gGLManager.mVRAM > 1536) + { + gMaxVideoRam = S32Megabytes(1024); + LL_INFOS() << "At least 2 GB video memory detected - increasing max video ram to " << gMaxVideoRam.value() << " MB" << LL_ENDL; + } +#endif + // + LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; // Prepare for out-of-memory situations, during which we will crash on diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 972db9a531..46dcbedfac 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -4024,9 +4024,6 @@ BOOL LLPanelPreferenceGraphics::postBuild() #endif // LL_DARWIN // - // Texture memory management - getChild("GraphicsCardTextureMemory")->setMaxValue((F32)gMaxVideoRam.value()); - return LLPanelPreference::postBuild(); } void LLPanelPreferenceGraphics::draw() diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6b60879548..388d355ffc 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -68,11 +68,7 @@ const S32Megabytes gMinVideoRam(32); // Texture memory management //const S32Megabytes gMaxVideoRam(512); -#ifdef ND_BUILD64BIT_ARCH -const S32Megabytes gMaxVideoRam(1024); -#else -const S32Megabytes gMaxVideoRam(512); -#endif +S32Megabytes gMaxVideoRam(512); // diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 04afa120e4..8de0f82233 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -40,7 +40,10 @@ #include extern const S32Megabytes gMinVideoRam; -extern const S32Megabytes gMaxVideoRam; +// Texture memory management +//extern const S32Megabytes gMaxVideoRam; +extern S32Megabytes gMaxVideoRam; +// class LLFace; class LLImageGL ; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index ed7af62c38..ee037bf718 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -1040,7 +1040,7 @@ layout="topleft" left="10" min_val="64" - max_val="1024" + max_val="2048" name="GraphicsCardTextureMemory" tool_tip="Amount of memory to allocate for textures. Defaults to video card memory up to 512M. Reducing this may improve performance but may also make textures blurry. Increasing this value beyond 512M is not recommended. Even if your graphics cards supports it, the main memory impact on the viewer is likely to lead to a degraded SL experience." top_pad="10"