summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-06-01 17:05:38 -0400
committerLogan Dethrow <log@lindenlab.com>2011-06-01 17:05:38 -0400
commit2662c4b679f0eb2745619dc4fd1dd79af65126f0 (patch)
treef27ba8675353676d91327fc606b005f0096b2fb9 /indra/newview/llfloaterpreference.cpp
parent4b97f03b04e7df25e5b3622122f6d124d4a5f617 (diff)
parent2002a39e4db5ba96f4a0a7653f76a3cd55846a31 (diff)
Merge. Pulling fix for VWR-25862 into bigger cache tree.
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llfloaterpreference.cpp58
1 files changed, 40 insertions, 18 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 396ea53ff3..60a2f813aa 100644..100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1007,9 +1007,15 @@ void LLFloaterPreference::refreshEnabledState()
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
// Avatar Render Mode
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
+
+ bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP");
+ if (LLViewerShaderMgr::sInitialized)
+ {
+ S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
+ avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE;
+ }
- S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
- ctrl_avatar_vp->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE);
+ ctrl_avatar_vp->setEnabled(avatar_vp_enabled);
if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||
gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)
@@ -1026,7 +1032,7 @@ void LLFloaterPreference::refreshEnabledState()
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
// radio set for terrain detail mode
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
-
+
ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
BOOL shaders = ctrl_shader_enable->get();
@@ -1049,26 +1055,28 @@ void LLFloaterPreference::refreshEnabledState()
//Deferred/SSAO/Shadows
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
- if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") &&
- LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
- shaders)
- {
- BOOL enabled = (ctrl_wind_light->get()) ? TRUE : FALSE;
+
+ BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
+ shaders &&
+ gGLManager.mHasFramebufferObject &&
+ gSavedSettings.getBOOL("RenderAvatarVP") &&
+ (ctrl_wind_light->get()) ? TRUE : FALSE;
- ctrl_deferred->setEnabled(enabled);
+ ctrl_deferred->setEnabled(enabled);
- LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
- LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail");
+ LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
+ LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF");
+ LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail");
- enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE);
+ enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE);
- ctrl_ssao->setEnabled(enabled);
+ ctrl_ssao->setEnabled(enabled);
+ ctrl_dof->setEnabled(enabled);
- enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail");
-
- ctrl_shadow->setEnabled(enabled);
- }
+ enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail");
+ ctrl_shadow->setEnabled(enabled);
+
// now turn off any features that are unavailable
disableUnavailableSettings();
@@ -1087,6 +1095,7 @@ void LLFloaterPreference::disableUnavailableSettings()
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail");
LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
+ LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF");
// if vertex shaders off, disable all shader related products
if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
@@ -1112,6 +1121,9 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_ssao->setEnabled(FALSE);
ctrl_ssao->setValue(FALSE);
+ ctrl_dof->setEnabled(FALSE);
+ ctrl_dof->setValue(FALSE);
+
ctrl_deferred->setEnabled(FALSE);
ctrl_deferred->setValue(FALSE);
}
@@ -1129,12 +1141,16 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_ssao->setEnabled(FALSE);
ctrl_ssao->setValue(FALSE);
+ ctrl_dof->setEnabled(FALSE);
+ ctrl_dof->setValue(FALSE);
+
ctrl_deferred->setEnabled(FALSE);
ctrl_deferred->setValue(FALSE);
}
// disabled deferred
- if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"))
+ if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") ||
+ !gGLManager.mHasFramebufferObject)
{
ctrl_shadows->setEnabled(FALSE);
ctrl_shadows->setValue(0);
@@ -1142,6 +1158,9 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_ssao->setEnabled(FALSE);
ctrl_ssao->setValue(FALSE);
+ ctrl_dof->setEnabled(FALSE);
+ ctrl_dof->setValue(FALSE);
+
ctrl_deferred->setEnabled(FALSE);
ctrl_deferred->setValue(FALSE);
}
@@ -1183,6 +1202,9 @@ void LLFloaterPreference::disableUnavailableSettings()
ctrl_ssao->setEnabled(FALSE);
ctrl_ssao->setValue(FALSE);
+ ctrl_dof->setEnabled(FALSE);
+ ctrl_dof->setValue(FALSE);
+
ctrl_deferred->setEnabled(FALSE);
ctrl_deferred->setValue(FALSE);
}