diff options
author | Dave Parks <davep@lindenlab.com> | 2014-03-11 17:42:02 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2014-03-11 17:42:02 -0500 |
commit | 02423199e89473c6aad2c6ab121d44c1f238dbd1 (patch) | |
tree | 4bb804729c65a892919ac5ae10a208c4dc0a9b1b | |
parent | cf2a180823e4e6daa0649ab54a5f7ed6ba14dbb2 (diff) | |
parent | 6abbe4cf55c2e4a6a879b00971bc5d70a7c58e8a (diff) |
Automated merge with https://bitbucket.org/lindenlab/viewer-lion
-rwxr-xr-x | indra/llmath/lloctree.h | 15 | ||||
-rwxr-xr-x | indra/llwindow/llwindowwin32.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 12 | ||||
-rwxr-xr-x | indra/newview/llfloaterhardwaresettings.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/llfloaterhardwaresettings.h | 2 | ||||
-rwxr-xr-x | indra/newview/llspatialpartition.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewercontrol.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewertexture.h | 2 | ||||
-rwxr-xr-x | indra/newview/llviewertexturelist.cpp | 15 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_hardware_settings.xml | 3 |
11 files changed, 67 insertions, 19 deletions
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 7348904c61..f7d5f14ba3 100755 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -36,6 +36,8 @@ extern U32 gOctreeMaxCapacity; +extern float gOctreeMinSize; + /*#define LL_OCTREE_PARANOIA_CHECK 0 #if LL_DARWIN #define LL_OCTREE_MAX_CAPACITY 32 @@ -106,6 +108,7 @@ public: : mParent((oct_node*)parent), mOctant(octant) { + llassert(size[0] >= gOctreeMinSize*0.5f); //always keep a NULL terminated list to avoid out of bounds exceptions in debug builds mData.push_back(NULL); mDataEnd = &mData[0]; @@ -213,7 +216,7 @@ public: F32 size = mSize[0]; F32 p_size = size * 2.f; - return (radius <= 0.001f && size <= 0.001f) || + return (radius <= gOctreeMinSize && size <= gOctreeMinSize) || (radius <= p_size && radius > size); } @@ -319,7 +322,7 @@ public: //is it here? if (isInside(data->getPositionGroup())) { - if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) || + if (((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius()) || (data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity))) { //it belongs here mData.push_back(NULL); @@ -356,8 +359,9 @@ public: LLVector4a val; val.setSub(center, getCenter()); val.setAbs(val); - - S32 lt = val.lessThan(LLVector4a::getEpsilon()).getGatheredBits() & 0x7; + LLVector4a min_diff(gOctreeMinSize); + + S32 lt = val.lessThan(min_diff).getGatheredBits() & 0x7; if( lt == 0x7 ) { @@ -389,6 +393,7 @@ public: } #endif + llassert(size[0] >= gOctreeMinSize*0.5f); //make the new kid child = new LLOctreeNode<T>(center, size, this); addChild(child); @@ -796,6 +801,8 @@ public: this->setSize(size2); this->updateMinMax(); + llassert(size[0] >= gOctreeMinSize); + //copy our children to a new branch LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index e45a511e6d..5106da09b2 100755 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -85,6 +85,18 @@ void show_window_creation_error(const std::string& title) LL_WARNS("Window") << title << LL_ENDL; } +HGLRC SafeCreateContext(HDC hdc) +{ + __try + { + return wglCreateContext(hdc); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + return NULL; + } +} + //static BOOL LLWindowWin32::sIsClassRegistered = FALSE; @@ -1166,14 +1178,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO return FALSE; } - if (!(mhRC = wglCreateContext(mhDC))) + + if (!(mhRC = SafeCreateContext(mhDC))) { close(); OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } - + if (!wglMakeCurrent(mhDC, mhRC)) { close(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6ebda3ff6a..dfbf6b0156 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7982,6 +7982,18 @@ <integer>128</integer> </map> + <key>OctreeMinimumNodeSize</key> + <map> + <key>Comment</key> + <string>Minimum size of any octree node</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.01</real> + </map> + <key>OctreeStaticObjectSizeFactor</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 792a2a5d25..6923308ce9 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -87,15 +87,30 @@ void LLFloaterHardwareSettings::refresh() refreshEnabledState(); } +void LLFloaterHardwareSettings::onSetVRAM() +{ + S32 vram = childGetValue("GraphicsCardTextureMemory").asInteger(); + + //give the texture system plenty of leeway to avoid swapping + vram /= 3; + + gSavedSettings.setS32("TextureMemory", vram); +} + void LLFloaterHardwareSettings::refreshEnabledState() { F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(true, mem_multiplier); getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); + S32 vram = gSavedSettings.getS32("TextureMemory"); + vram = vram*3; + + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setValue(vram); + getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setCommitCallback(boost::bind(&LLFloaterHardwareSettings::onSetVRAM, this)); if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h index 626771b1d2..63d86d5667 100755 --- a/indra/newview/llfloaterhardwaresettings.h +++ b/indra/newview/llfloaterhardwaresettings.h @@ -64,6 +64,8 @@ public: /// don't apply the changed values void cancel(); + void onSetVRAM(); + /// refresh the enabled values void refreshEnabledState(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 2c83f6d0b7..69ba51b10a 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -78,6 +78,7 @@ U32 LLSpatialGroup::sNodeCount = 0; std::set<GLuint> LLSpatialGroup::sPendingQueries; U32 gOctreeMaxCapacity; +F32 gOctreeMinSize; BOOL LLSpatialGroup::sNoDelete = FALSE; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 744ec4de2b..002a337e04 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -368,6 +368,7 @@ static bool handleRepartition(const LLSD&) if (gPipeline.isInit()) { gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity"); + gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize"); gObjectList.repartitionObjects(); } return true; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 10101a4b9b..78db136427 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -40,7 +40,7 @@ #include <list> #define MIN_VIDEO_RAM_IN_MEGA_BYTES 32 -#define MAX_VIDEO_RAM_IN_MEGA_BYTES 512 // 512MB max for performance reasons. +#define MAX_VIDEO_RAM_IN_MEGA_BYTES 4096 class LLImageGL ; class LLImageRaw; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 783d1f2202..26f32941bf 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1270,7 +1270,7 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_m // - it's going to be swapping constantly regardless S32 max_vram = gGLManager.mVRAM; - if(gGLManager.mIsATI) + if(!get_recommended && gGLManager.mIsATI) { //shrink the availabe vram for ATI cards because some of them do not handel texture swapping well. max_vram = (S32)(max_vram * 0.75f); @@ -1285,15 +1285,15 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_m { if (!get_recommended) { - max_texmem = 512; + max_texmem = 2048; } else if (gSavedSettings.getBOOL("NoHardwareProbe")) //did not do hardware detection at startup { - max_texmem = 512; + max_texmem = 2048; } else { - max_texmem = 128; + max_texmem = 512; } llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl; @@ -1301,10 +1301,7 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_m S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB //llinfos << "*** DETECTED " << system_ram << " MB of system memory." << llendl; - if (get_recommended) - max_texmem = llmin(max_texmem, (S32)(system_ram/2)); - else - max_texmem = llmin(max_texmem, (S32)(system_ram)); + max_texmem = llmin(max_texmem, (S32)(system_ram)); // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise max_texmem = llmin(max_texmem, (S32) (mem_multiplier * (F32) max_texmem)); @@ -1334,7 +1331,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting(false, mem_multiplier)); if (mem != cur_mem) { - gSavedSettings.setS32("TextureMemory", mem); + gSavedSettings.setS32("TextureMemory", mem/3); return; //listener will re-enter this function } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5da8a78b1b..ab6e5cc353 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -498,6 +498,7 @@ void LLPipeline::init() refreshCachedSettings(); gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity"); + gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize"); sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD"); sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 9deb0d2030..05594c2d86 100755 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -155,13 +155,12 @@ tool_tip="Compresses textures in video memory, allowing for higher resolution textures to be loaded at the cost of some color quality." width="315" /> <slider - control_name="TextureMemory" decimal_digits="0" follows="left|top" height="20" increment="16" initial_value="32" - label="Texture Memory (MB):" + label="Video Memory (MB):" label_width="195" layout="topleft" left="10" |