summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-30 15:01:40 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-30 17:04:35 -0700
commit08f0f6d8330e0eb654e1661f8c661d5222992933 (patch)
treed2460765ededf6c1ec6471fdd1b995e9137927f6 /indra/newview/llviewershadermgr.cpp
parent8b92652806ddc239e8d2627151ce2dab6faf138f (diff)
SL-16386 remove references to (const true) LLPipeline::mVertexShadersEnabled
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp220
1 files changed, 109 insertions, 111 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index d37678e24f..26592adc0a 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -558,164 +558,162 @@ void LLViewerShaderMgr::setShaders()
return;
}
- gPipeline.mVertexShadersEnabled = TRUE;
- gPipeline.mVertexShadersLoaded = 1;
+ gPipeline.mVertexShadersLoaded = 1;
- // Load all shaders to set max levels
- loaded = loadShadersEnvironment();
+ // Load all shaders to set max levels
+ loaded = loadShadersEnvironment();
+ if (loaded)
+ {
+ LL_INFOS() << "Loaded environment shaders." << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS() << "Failed to load environment shaders." << LL_ENDL;
+ llassert(loaded);
+ }
+
+ if (loaded)
+ {
+ loaded = loadShadersWater();
if (loaded)
{
- LL_INFOS() << "Loaded environment shaders." << LL_ENDL;
+ LL_INFOS() << "Loaded water shaders." << LL_ENDL;
}
else
{
- LL_WARNS() << "Failed to load environment shaders." << LL_ENDL;
+ LL_WARNS() << "Failed to load water shaders." << LL_ENDL;
llassert(loaded);
}
+ }
+ if (loaded)
+ {
+ loaded = loadShadersWindLight();
if (loaded)
{
- loaded = loadShadersWater();
- if (loaded)
- {
- LL_INFOS() << "Loaded water shaders." << LL_ENDL;
- }
- else
- {
- LL_WARNS() << "Failed to load water shaders." << LL_ENDL;
- llassert(loaded);
- }
+ LL_INFOS() << "Loaded windlight shaders." << LL_ENDL;
}
-
- if (loaded)
+ else
{
- loaded = loadShadersWindLight();
- if (loaded)
- {
- LL_INFOS() << "Loaded windlight shaders." << LL_ENDL;
- }
- else
- {
- LL_WARNS() << "Failed to load windlight shaders." << LL_ENDL;
- llassert(loaded);
- }
+ LL_WARNS() << "Failed to load windlight shaders." << LL_ENDL;
+ llassert(loaded);
}
+ }
+ if (loaded)
+ {
+ loaded = loadShadersEffects();
if (loaded)
{
- loaded = loadShadersEffects();
- if (loaded)
- {
- LL_INFOS() << "Loaded effects shaders." << LL_ENDL;
- }
- else
- {
- LL_WARNS() << "Failed to load effects shaders." << LL_ENDL;
- llassert(loaded);
- }
+ LL_INFOS() << "Loaded effects shaders." << LL_ENDL;
}
-
- if (loaded)
+ else
{
- loaded = loadShadersInterface();
- if (loaded)
- {
- LL_INFOS() << "Loaded interface shaders." << LL_ENDL;
- }
- else
- {
- LL_WARNS() << "Failed to load interface shaders." << LL_ENDL;
- llassert(loaded);
- }
+ LL_WARNS() << "Failed to load effects shaders." << LL_ENDL;
+ llassert(loaded);
}
+ }
+ if (loaded)
+ {
+ loaded = loadShadersInterface();
if (loaded)
-
{
- loaded = loadTransformShaders();
- if (loaded)
- {
- LL_INFOS() << "Loaded transform shaders." << LL_ENDL;
- }
- else
- {
- LL_WARNS() << "Failed to load transform shaders." << LL_ENDL;
- llassert(loaded);
- }
+ LL_INFOS() << "Loaded interface shaders." << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS() << "Failed to load interface shaders." << LL_ENDL;
+ llassert(loaded);
}
+ }
+ if (loaded)
+
+ {
+ loaded = loadTransformShaders();
if (loaded)
{
- // Load max avatar shaders to set the max level
- mShaderLevel[SHADER_AVATAR] = 3;
- mMaxAvatarShaderLevel = 3;
+ LL_INFOS() << "Loaded transform shaders." << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS() << "Failed to load transform shaders." << LL_ENDL;
+ llassert(loaded);
+ }
+ }
+
+ if (loaded)
+ {
+ // Load max avatar shaders to set the max level
+ mShaderLevel[SHADER_AVATAR] = 3;
+ mMaxAvatarShaderLevel = 3;
if (loadShadersObject())
- { //hardware skinning is enabled and rigged attachment shaders loaded correctly
- BOOL avatar_cloth = gSavedSettings.getBOOL("RenderAvatarCloth");
+ { //hardware skinning is enabled and rigged attachment shaders loaded correctly
+ BOOL avatar_cloth = gSavedSettings.getBOOL("RenderAvatarCloth");
- // cloth is a class3 shader
- S32 avatar_class = avatar_cloth ? 3 : 1;
+ // cloth is a class3 shader
+ S32 avatar_class = avatar_cloth ? 3 : 1;
- // Set the actual level
- mShaderLevel[SHADER_AVATAR] = avatar_class;
+ // Set the actual level
+ mShaderLevel[SHADER_AVATAR] = avatar_class;
- loaded = loadShadersAvatar();
- llassert(loaded);
+ loaded = loadShadersAvatar();
+ llassert(loaded);
- if (mShaderLevel[SHADER_AVATAR] != avatar_class)
+ if (mShaderLevel[SHADER_AVATAR] != avatar_class)
+ {
+ if(llmax(mShaderLevel[SHADER_AVATAR]-1,0) >= 3)
{
- if(llmax(mShaderLevel[SHADER_AVATAR]-1,0) >= 3)
- {
- avatar_cloth = true;
- }
- else
- {
- avatar_cloth = false;
- }
- gSavedSettings.setBOOL("RenderAvatarCloth", avatar_cloth);
+ avatar_cloth = true;
}
+ else
+ {
+ avatar_cloth = false;
+ }
+ gSavedSettings.setBOOL("RenderAvatarCloth", avatar_cloth);
}
- else
- { //hardware skinning not possible, neither is deferred rendering
- mShaderLevel[SHADER_AVATAR] = 0;
- mShaderLevel[SHADER_DEFERRED] = 0;
+ }
+ else
+ { //hardware skinning not possible, neither is deferred rendering
+ mShaderLevel[SHADER_AVATAR] = 0;
+ mShaderLevel[SHADER_DEFERRED] = 0;
- gSavedSettings.setBOOL("RenderDeferred", FALSE);
- gSavedSettings.setBOOL("RenderAvatarCloth", FALSE);
+ gSavedSettings.setBOOL("RenderDeferred", FALSE);
+ gSavedSettings.setBOOL("RenderAvatarCloth", FALSE);
- loadShadersAvatar(); // unloads
+ loadShadersAvatar(); // unloads
- loaded = loadShadersObject();
- llassert(loaded);
- }
+ loaded = loadShadersObject();
+ llassert(loaded);
}
+ }
- if (!loaded)
- { //some shader absolutely could not load, try to fall back to a simpler setting
- if (gSavedSettings.getBOOL("WindLightUseAtmosShaders"))
- { //disable windlight and try again
- gSavedSettings.setBOOL("WindLightUseAtmosShaders", FALSE);
- LL_WARNS() << "Falling back to no windlight shaders." << LL_ENDL;
- reentrance = false;
- setShaders();
- return;
- }
- }
-
- llassert(loaded);
-
- if (loaded && !loadShadersDeferred())
- { //everything else succeeded but deferred failed, disable deferred and try again
- gSavedSettings.setBOOL("RenderDeferred", FALSE);
- LL_WARNS() << "Falling back to no deferred shaders." << LL_ENDL;
+ if (!loaded)
+ { //some shader absolutely could not load, try to fall back to a simpler setting
+ if (gSavedSettings.getBOOL("WindLightUseAtmosShaders"))
+ { //disable windlight and try again
+ gSavedSettings.setBOOL("WindLightUseAtmosShaders", FALSE);
+ LL_WARNS() << "Falling back to no windlight shaders." << LL_ENDL;
reentrance = false;
setShaders();
return;
}
+ }
+
+ llassert(loaded);
+
+ if (loaded && !loadShadersDeferred())
+ { //everything else succeeded but deferred failed, disable deferred and try again
+ gSavedSettings.setBOOL("RenderDeferred", FALSE);
+ LL_WARNS() << "Falling back to no deferred shaders." << LL_ENDL;
+ reentrance = false;
+ setShaders();
+ return;
+ }
- // gPipeline.mVertexShadersEnabled = FALSE;
// gPipeline.mVertexShadersLoaded = 0;
if (gViewerWindow)