From 08f0f6d8330e0eb654e1661f8c661d5222992933 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 30 Nov 2021 15:01:40 -0700 Subject: SL-16386 remove references to (const true) LLPipeline::mVertexShadersEnabled --- indra/newview/llviewershadermgr.cpp | 220 ++++++++++++++++++------------------ indra/newview/llviewerwindow.cpp | 6 - indra/newview/pipeline.cpp | 6 +- indra/newview/pipeline.h | 2 - 4 files changed, 110 insertions(+), 124 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) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 10631afd13..6462ec019b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -608,12 +608,6 @@ public: { LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); - if (gPipeline.getUseVertexShaders() == 0) - { - addText(xpos, ypos, "Shaders Disabled"); - ypos += y_inc; - } - if (gGLManager.mHasATIMemInfo) { S32 meminfo[4]; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8881b78593..63e101a290 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -376,7 +376,6 @@ LLPipeline::LLPipeline() : mNumVisibleFaces(0), mInitialized(false), - mVertexShadersEnabled(false), mVertexShadersLoaded(0), mTransformFeedbackPrimitives(0), mRenderDebugFeatureMask(0), @@ -1364,10 +1363,7 @@ void LLPipeline::restoreGL() { assertInitialized(); - if (mVertexShadersEnabled) - { - LLViewerShaderMgr::instance()->setShaders(); - } + LLViewerShaderMgr::instance()->setShaders(); for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index d82f8bd64b..50a730077e 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -226,7 +226,6 @@ public: S32 getMaxLightingDetail() const; void setUseVertexShaders(bool use_shaders); - bool getUseVertexShaders() const { return mVertexShadersEnabled; } bool canUseVertexShaders(); bool canUseWindLightShaders() const; bool canUseWindLightShadersOnObjects() const; @@ -702,7 +701,6 @@ public: LLVector4 mTransformedMoonDir; bool mInitialized; - bool mVertexShadersEnabled; S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback -- cgit v1.2.3