summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llgl.cpp10
-rw-r--r--indra/llrender/llgl.h1
-rw-r--r--indra/newview/featuretable.txt6
-rw-r--r--indra/newview/featuretable_xp.txt6
-rw-r--r--indra/newview/llappviewerwin32.cpp6
-rw-r--r--indra/newview/llfeaturemanager.cpp4
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp25
-rw-r--r--indra/newview/llselectmgr.cpp20
-rw-r--r--indra/newview/llviewerwindow.cpp17
9 files changed, 80 insertions, 15 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 9354373dba..d1eb4c8be0 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -313,6 +313,7 @@ LLGLManager::LLGLManager() :
mIsDisabled(FALSE),
mHasMultitexture(FALSE),
+ mHasATIMemInfo(FALSE),
mNumTextureUnits(1),
mHasMipMapGeneration(FALSE),
mHasCompressedTextures(FALSE),
@@ -497,6 +498,14 @@ bool LLGLManager::initGL()
// This is called here because it depends on the setting of mIsGF2or4MX, and sets up mHasMultitexture.
initExtensions();
+ if (mHasATIMemInfo)
+ { //ask the gl how much vram is free at startup and attempt to use no more than half of that
+ S32 meminfo[4];
+ glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo);
+
+ mVRAM = meminfo[0]/1024;
+ }
+
if (mHasMultitexture)
{
GLint num_tex_units;
@@ -659,6 +668,7 @@ void LLGLManager::initExtensions()
mHasTextureRectangle = FALSE;
#else // LL_MESA_HEADLESS
mHasMultitexture = glh_init_extensions("GL_ARB_multitexture");
+ mHasATIMemInfo = ExtensionExists("GL_ATI_meminfo", gGLHExts.mSysExts);
mHasMipMapGeneration = glh_init_extensions("GL_SGIS_generate_mipmap");
mHasSeparateSpecularColor = glh_init_extensions("GL_EXT_separate_specular_color");
mHasAnisotropic = glh_init_extensions("GL_EXT_texture_filter_anisotropic");
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index df110613e3..f4be067f2e 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -76,6 +76,7 @@ public:
// Extensions used by everyone
BOOL mHasMultitexture;
+ BOOL mHasATIMemInfo;
S32 mNumTextureUnits;
BOOL mHasMipMapGeneration;
BOOL mHasCompressedTextures;
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index afc268d7a5..6022153020 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -1,4 +1,4 @@
-version 26
+version 27
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@@ -465,6 +465,10 @@ list ATI
RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
+// Disable vertex buffer objects by default for ATI cards with little video memory
+list ATIVramLT256
+RenderVBOEnable 1 0
+
/// Tweaked NVIDIA
list NVIDIA_GeForce_FX_5100
diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt
index 84da74840f..10aeffef01 100644
--- a/indra/newview/featuretable_xp.txt
+++ b/indra/newview/featuretable_xp.txt
@@ -1,4 +1,4 @@
-version 26
+version 27
// NOTE: This is mostly identical to featuretable_mac.txt with a few differences
// Should be combined into one table
@@ -463,6 +463,10 @@ list ATI
RenderUseStreamVBO 1 0
RenderAvatarVP 1 0
+// Disable vertex buffer objects by default for ATI cards with little video memory
+list ATIVramLT256
+RenderVBOEnable 1 0
+
/// Tweaked NVIDIA
list NVIDIA_GeForce_FX_5100
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index d328567a0e..54689ea808 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -440,7 +440,11 @@ bool LLAppViewerWin32::initHardwareTest()
LL_WARNS("AppInit") << " Someone took over my exception handler (post hardware probe)!" << LL_ENDL;
}
- gGLManager.mVRAM = gDXHardware.getVRAM();
+ if (gGLManager.mVRAM == 0)
+ {
+ gGLManager.mVRAM = gDXHardware.getVRAM();
+ }
+
LL_INFOS("AppInit") << "Detected VRAM: " << gGLManager.mVRAM << LL_ENDL;
return true;
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index edfc4538a1..9f0b34becc 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -729,6 +729,10 @@ void LLFeatureManager::applyBaseMasks()
{
maskFeatures("ATI");
}
+ if (gGLManager.mHasATIMemInfo && gGLManager.mVRAM < 256)
+ {
+ maskFeatures("ATIVramLT256");
+ }
if (gGLManager.mATIOldDriver)
{
maskFeatures("ATIOldDriver");
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index fabf92c3c6..f65fab41e7 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -2787,9 +2787,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
lod_mode = GLOD_TRIANGLE_BUDGET;
if (which_lod != -1)
{
- //SH-632 take budget as supplied limit+1 to prevent GLOD from creating a smaller
- //decimation when the given decimation is possible
- limit = mFMP->childGetValue("lod_triangle_limit").asInteger(); //+1;
+ limit = mFMP->childGetValue("lod_triangle_limit").asInteger();
}
}
else
@@ -2948,13 +2946,6 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
{
start = end = which_lod;
}
- else
- {
- //SH-632 -- incremenet triangle count to avoid removing any triangles from
- //highest LoD when auto-generating LoD
- triangle_count++;
- }
-
mMaxTriangleLimit = base_triangle_count;
@@ -2998,15 +2989,25 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
glodGroupParameteri(mGroup, GLOD_ERROR_MODE, GLOD_OBJECT_SPACE_ERROR);
stop_gloderror();
- glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, triangle_count);
+ glodGroupParameterf(mGroup, GLOD_OBJECT_SPACE_ERROR_THRESHOLD, lod_error_threshold);
stop_gloderror();
- glodGroupParameterf(mGroup, GLOD_OBJECT_SPACE_ERROR_THRESHOLD, lod_error_threshold);
+ glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, 0);
stop_gloderror();
glodAdaptGroup(mGroup);
stop_gloderror();
+ if (lod_mode == GLOD_TRIANGLE_BUDGET)
+ { //SH-632 Always adapt to 0 before adapting to actual desired amount, and always
+ //add 1 to desired amount to avoid decimating below desired amount
+ glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, triangle_count+1);
+ stop_gloderror();
+
+ glodAdaptGroup(mGroup);
+ stop_gloderror();
+ }
+
for (U32 mdl_idx = 0; mdl_idx < mBaseModel.size(); ++mdl_idx)
{
LLModel* base = mBaseModel[mdl_idx];
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 21a457c125..b139ba361e 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -3902,6 +3902,26 @@ void LLSelectMgr::sendDelink()
return;
}
+ struct f : public LLSelectedObjectFunctor
+ { //on delink, any modifyable object should
+ f() {}
+
+ virtual bool apply(LLViewerObject* object)
+ {
+ if (object->permModify())
+ {
+ if (object->getPhysicsShapeType() == LLViewerObject::PHYSICS_SHAPE_NONE)
+ {
+ object->setPhysicsShapeType(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
+ object->updateFlags();
+ }
+ }
+ return true;
+ }
+ } sendfunc;
+ getSelection()->applyToObjects(&sendfunc);
+
+
// Delink needs to send individuals so you can unlink a single object from
// a linked set.
sendListToRegions(
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 6561f1bcf6..093e94add0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -465,6 +465,23 @@ public:
addText(xpos, ypos, "Shaders Disabled");
ypos += y_inc;
}
+
+ if (gGLManager.mHasATIMemInfo)
+ {
+ S32 meminfo[4];
+ glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo);
+
+ addText(xpos, ypos, llformat("%.2f MB Texture Memory Free", meminfo[0]/1024.f));
+ ypos += y_inc;
+
+ if (gGLManager.mHasVertexBufferObject)
+ {
+ glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, meminfo);
+ addText(xpos, ypos, llformat("%.2f MB VBO Memory Free", meminfo[0]/1024.f));
+ ypos += y_inc;
+ }
+ }
+
addText(xpos, ypos, llformat("%d MB Vertex Data", LLVertexBuffer::sAllocatedBytes/(1024*1024)));
ypos += y_inc;