SH-2622 Put back "Basic Shaders" toggle ability.

master
Dave Parks 2011-10-25 15:07:57 -05:00
parent 30d1a2d053
commit 7dafa1be79
4 changed files with 38 additions and 9 deletions

View File

@ -1767,7 +1767,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
error = TRUE;
}
glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
/*glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
if (active_texture != GL_TEXTURE0_ARB)
{
llwarns << "Active texture corrupted: " << active_texture << llendl;
@ -1776,7 +1776,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
gFailLog << "Active texture corrupted: " << active_texture << std::endl;
}
error = TRUE;
}
}*/
static const char* label[] =
{

View File

@ -1034,19 +1034,30 @@ void LLFloaterPreference::refreshEnabledState()
}
// Vertex Shaders
// Global Shader Enable
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
// radio set for terrain detail mode
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
BOOL shaders = gGLManager.mGLVersion >= 2.f;
mRadioTerrainDetail->setEnabled(TRUE);
ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
BOOL shaders = ctrl_shader_enable->get();
if (shaders)
{
mRadioTerrainDetail->setValue(1);
mRadioTerrainDetail->setEnabled(FALSE);
}
else
{
mRadioTerrainDetail->setEnabled(TRUE);
}
// WindLight
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
// *HACK just checks to see if we can use shaders...
// maybe some cards that use shaders, but don't support windlight
ctrl_wind_light->setEnabled(shaders);
ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
//Deferred/SSAO/Shadows
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@ -1084,6 +1095,7 @@ void LLFloaterPreference::disableUnavailableSettings()
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@ -1094,6 +1106,9 @@ void LLFloaterPreference::disableUnavailableSettings()
// if vertex shaders off, disable all shader related products
if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
{
ctrl_shader_enable->setEnabled(FALSE);
ctrl_shader_enable->setValue(FALSE);
ctrl_wind_light->setEnabled(FALSE);
ctrl_wind_light->setValue(FALSE);

View File

@ -363,8 +363,8 @@ void LLViewerShaderMgr::setShaders()
reentrance = true;
if (LLRender::sGLCoreProfile || (gGLManager.mGLVersion >= 2.f && !gGLManager.mIsIntel))
{ //ALWAYS use shaders where available (except for intel, intel prefers fixed function)
if (LLRender::sGLCoreProfile)
{
if (!gSavedSettings.getBOOL("VertexShaderEnable"))
{ //vertex shaders MUST be enabled to use core profile
gSavedSettings.setBOOL("VertexShaderEnable", TRUE);

View File

@ -204,6 +204,20 @@
name="LocalLights"
top_pad="1"
width="256" />
<check_box
control_name="VertexShaderEnable"
height="16"
initial_value="true"
label="Basic shaders"
layout="topleft"
left_delta="0"
name="BasicShaders"
tool_tip="Disabling this option may prevent some graphics card drivers from crashing"
top_pad="1"
width="315">
<check_box.commit_callback
function="Pref.VertexShaderEnable" />
</check_box>
<check_box
control_name="WindLightUseAtmosShaders"
height="16"