From 83e69659e2c950bec02df8c8e1b15fbc34ca1dc6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 8 Mar 2012 15:22:56 -0600 Subject: MAINT-708 Add checkbox to hardware settings for controlling texture compression. Default texture compression to on for cards with 512MB of VRAM or less, off otherwise. --- indra/llrender/llgl.cpp | 2 +- indra/newview/featuretable.txt | 7 +++++++ indra/newview/featuretable_linux.txt | 7 +++++++ indra/newview/featuretable_mac.txt | 8 ++++++++ indra/newview/featuretable_xp.txt | 7 +++++++ indra/newview/llfeaturemanager.cpp | 4 ++++ indra/newview/llfloaterhardwaresettings.cpp | 6 ++++++ .../default/xui/en/floater_hardware_settings.xml | 22 ++++++++++++++++++++++ 8 files changed, 62 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index fdb674c433..3f78ab20d0 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -576,7 +576,7 @@ bool LLGLManager::initGL() #endif } - if (mGLVersion >= 3.f && LLImageGL::sCompressTextures) + if (mGLVersion >= 2.1f && LLImageGL::sCompressTextures) { //use texture compression glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST); } diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 76bb2b0976..99721c3638 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -61,6 +61,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -222,6 +223,12 @@ RenderVBOEnable 1 1 list Class3 RenderVBOEnable 1 1 +// +// VRAM > 512MB +// +list VRAMGT512 +RenderCompressTextures 1 0 + // // No Pixel Shaders available // diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 5e217e000a..289fd2ffbe 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -61,6 +61,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -219,6 +220,12 @@ RenderVBOEnable 1 1 list Class3 RenderVBOEnable 1 1 +// +// VRAM > 512MB +// +list VRAMGT512 +RenderCompressTextures 1 0 + // // No Pixel Shaders available // diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 915a012a39..3fcfb411d2 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -61,6 +61,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 0.5 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -247,6 +248,12 @@ RenderDeferred 0 0 RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 +// +// VRAM > 512MB +// +list VRAMGT512 +RenderCompressTextures 1 0 + // // "Default" setups for safe, low, medium, high // @@ -286,6 +293,7 @@ RenderObjectBump 0 0 list OpenGLPre15 RenderVBOEnable 1 0 + list TexUnit8orLess RenderDeferredSSAO 0 0 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index ae2cf910f2..f0f64e898e 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -61,6 +61,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 0 RenderDeferredSSAO 1 0 @@ -221,6 +222,12 @@ RenderVBOEnable 1 1 list Class3 RenderVBOEnable 1 1 +// +// VRAM > 512MB +// +list VRAMGT512 +RenderCompressTextures 1 0 + // // No Pixel Shaders available // diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 08f9d26705..82f38ae4e9 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -779,6 +779,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("MapBufferRange"); } + if (gGLManager.mVRAM > 512) + { + maskFeatures("VRAMGT512"); + } // now mask by gpu string // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index f9a403cf9f..e8f1d58df8 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -99,6 +99,12 @@ void LLFloaterHardwareSettings::refreshEnabledState() getChildView("vbo")->setEnabled(FALSE); } + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("texture compression")->setEnabled(FALSE); + } + // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance LLSpinCtrl* gamma_ctrl = getChild("gamma"); gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); 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 66bb9d3cea..9deb0d2030 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -132,6 +132,28 @@ name="vbo" tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled." width="315" /> + + Enable S3TC: + +