summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp55
1 files changed, 12 insertions, 43 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 0e29851778..86b1a8c910 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -317,16 +317,10 @@ S32 LLViewerShaderMgr::getVertexShaderLevel(S32 type)
void LLViewerShaderMgr::setShaders()
{
- //setShaders might be called redundantly by gSavedSettings, so return on reentrance
- static bool reentrance = false;
-
- if (!gPipeline.mInitialized || !sInitialized || reentrance)
+ if (!gPipeline.mInitialized || !sInitialized)
{
return;
}
-
- reentrance = true;
-
// Make sure the compiled shader map is cleared before we recompile shaders.
mShaderObjects.clear();
@@ -374,11 +368,17 @@ void LLViewerShaderMgr::setShaders()
S32 wl_class = 2;
S32 water_class = 2;
S32 deferred_class = 0;
-
- if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
- gSavedSettings.getBOOL("RenderDeferred"))
+ if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")
+ && gSavedSettings.getBOOL("WindLightUseAtmosShaders")))
+ {
+ // user has disabled WindLight in their settings, downgrade
+ // windlight shaders to stub versions.
+ wl_class = 1;
+ }
+
+ if (LLPipeline::sRenderDeferred)
{
- if (gSavedSettings.getS32("RenderShadowDetail") > 0)
+ if (gSavedSettings.getBOOL("RenderDeferredShadow"))
{
if (gSavedSettings.getBOOL("RenderDeferredGI"))
{ //shadows + gi
@@ -393,24 +393,6 @@ void LLViewerShaderMgr::setShaders()
{ //no shadows
deferred_class = 1;
}
-
- //make sure framebuffer objects are enabled
- gSavedSettings.setBOOL("RenderUseFBO", TRUE);
-
- //make sure hardware skinning is enabled
- gSavedSettings.setBOOL("RenderAvatarVP", TRUE);
-
- //make sure atmospheric shaders are enabled
- gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE);
- }
-
-
- if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")
- && gSavedSettings.getBOOL("WindLightUseAtmosShaders")))
- {
- // user has disabled WindLight in their settings, downgrade
- // windlight shaders to stub versions.
- wl_class = 1;
}
if(!gSavedSettings.getBOOL("EnableRippleWater"))
@@ -535,8 +517,6 @@ void LLViewerShaderMgr::setShaders()
gViewerWindow->setCursor(UI_CURSOR_ARROW);
}
gPipeline.createGLBuffers();
-
- reentrance = false;
}
void LLViewerShaderMgr::unloadShaders()
@@ -993,21 +973,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
if (success)
{
- std::string fragment;
-
- if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
- {
- fragment = "deferred/sunLightSSAOF.glsl";
- }
- else
- {
- fragment = "deferred/sunLightF.glsl";
- }
-
gDeferredSunProgram.mName = "Deferred Sun Shader";
gDeferredSunProgram.mShaderFiles.clear();
gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB));
- gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB));
+ gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredSunProgram.createShader(NULL, NULL);
}