From c162d8a060e9b48a7945eb0b1bdafbff959b7faf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 9 Dec 2024 20:18:37 +0200 Subject: [PATCH 1/8] #3222 Emoji tabs losing symbols --- indra/llui/lluistring.cpp | 6 ++++++ indra/llui/lluistring.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index bfadeb8428..ab6de16639 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -47,6 +47,12 @@ void LLUIString::assign(const std::string& s) dirty(); } +void LLUIString::assign(const LLWString& instring) +{ + mOrig = wstring_to_utf8str(instring); + dirty(); +} + void LLUIString::setArgList(const LLStringUtil::format_map_t& args) { diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index b9d4ff0ebb..2512634004 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -61,10 +61,11 @@ public: LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); } - LLUIString(const LLWString& instring) : mArgs(NULL) { insert(0, instring); } + LLUIString(const LLWString& instring) : mArgs(NULL) { assign(instring); } ~LLUIString() { delete mArgs; } void assign(const std::string& instring); + void assign(const LLWString& instring); LLUIString& operator=(const std::string& s) { assign(s); return *this; } void setArgList(const LLStringUtil::format_map_t& args); From 23e9c8cf309198b62dbfdb48fb9d56af51079ffe Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 10 Dec 2024 15:20:27 +0200 Subject: [PATCH 2/8] #3222 Make sure variables are initialized in case anybody adds more constructors and forgets to set init. --- indra/llui/lluistring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index 2512634004..950d4e72c6 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -110,8 +110,8 @@ private: LLStringUtil::format_map_t* mArgs; // controls lazy evaluation - mutable bool mNeedsResult; - mutable bool mNeedsWResult; + mutable bool mNeedsResult { true }; + mutable bool mNeedsWResult { true }; }; #endif // LL_LLUISTRING_H From dff8a2aaabbf47dd9b2221dacdf4a905287a9b11 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 10 Dec 2024 09:06:25 -0800 Subject: [PATCH 3/8] #3248 Fix for stars not rendering when emissive enabled (#3250) --- indra/newview/llviewershadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9f04c98770..7ce9c02e8d 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2811,7 +2811,7 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredStarProgram.mShaderGroup = LLGLSLShader::SG_SKY; gDeferredStarProgram.addConstant( LLGLSLShader::SHADER_CONST_STAR_DEPTH ); // SL-14113 - add_common_permutations(&gDeferredWLSkyProgram); + add_common_permutations(&gDeferredStarProgram); success = gDeferredStarProgram.createShader(); llassert(success); From b76ea8f1d71db6e8626be18cab101535731d7d74 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 10 Dec 2024 09:07:44 -0800 Subject: [PATCH 4/8] #3251 Remove obsolete intel driver notification (#3252) --- indra/newview/llappviewer.cpp | 47 ------------------- .../skins/default/xui/en/notifications.xml | 6 --- .../skins/default/xui/pl/notifications.xml | 5 -- 3 files changed, 58 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 08b7b439e8..f79eb5ddce 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1038,53 +1038,6 @@ bool LLAppViewer::init() } } -#if LL_WINDOWS && ADDRESS_SIZE == 64 - if (gGLManager.mIsIntel) - { - // Check intel driver's version - // Ex: "3.1.0 - Build 8.15.10.2559"; - std::string version = ll_safe_string((const char *)glGetString(GL_VERSION)); - - const boost::regex is_intel_string("[0-9].[0-9].[0-9] - Build [0-9]{1,2}.[0-9]{2}.[0-9]{2}.[0-9]{4}"); - - if (boost::regex_search(version, is_intel_string)) - { - // Valid string, extract driver version - std::size_t found = version.find("Build "); - std::string driver = version.substr(found + 6); - S32 v1, v2, v3, v4; - S32 count = sscanf(driver.c_str(), "%d.%d.%d.%d", &v1, &v2, &v3, &v4); - if (count > 0 && v1 <= 10) - { - LL_INFOS("AppInit") << "Detected obsolete intel driver: " << driver << LL_ENDL; - - if (!gViewerWindow->getInitAlert().empty() // graphic initialization crashed on last run - || LLVersionInfo::getInstance()->getChannelAndVersion() != gLastRunVersion // viewer was updated - || mNumSessions % 20 == 0 //periodically remind user to update driver - ) - { - LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedIntelDriver"); - std::string gpu_name = ll_safe_string((const char *)glGetString(GL_RENDERER)); - LL_INFOS("AppInit") << "Notifying user about obsolete intel driver for " << gpu_name << LL_ENDL; - details.setArg("[VERSION]", driver); - details.setArg("[GPUNAME]", gpu_name); - S32 button = OSMessageBox(details.getString(), - LLStringUtil::null, - OSMB_YESNO); - if (OSBTN_YES == button && gViewerWindow) - { - std::string url = LLWeb::escapeURL(LLTrans::getString("IntelDriverPage")); - if (gViewerWindow->getWindow()) - { - gViewerWindow->getWindow()->spawnWebBrowser(url, false); - } - } - } - } - } - } -#endif - // Obsolete? mExpectedGLVersion is always zero #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ee93c8b000..b63ab2f8d2 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10159,12 +10159,6 @@ Do you wish to continue? yestext="OK"/> - -The installed Intel graphics driver for [GPUNAME], version [VERSION], is significantly out of date and is known to cause excessive rates of program crashes. You are strongly advised to update to a current Intel driver - -Do you want to check the Intel driver website? - - 796 diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index e668c6cc20..ad9d2ecf1d 100644 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -3577,11 +3577,6 @@ Czy chcesz kontynuować? Wybrany obiekt ma wpływ na Navmesh. Dodanie elastyczności spowoduje usunięcie go z Navmesha. - - Zainstalowany sterownik graficzny Intela dla [GPUNAME], wersja [VERSION], jest przestarzały i jest znany z powodowania awarii. Zdecydowanie zaleca się aktualizację do aktualnego sterownika Intel. - -Czy chcesz sprawdzić witrynę sterowników firmy Intel? - - Twoja karta graficzna nie spełnia minimalnych wymagań. From 5f9fe87808bdf48186ed295e735bf2dced7e4e33 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 10 Dec 2024 09:09:07 -0800 Subject: [PATCH 5/8] Fix for assert (and potential crash) in LLAvatarPropertiesProcessor coroutine (#3253) --- indra/newview/llavatarpropertiesprocessor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 299cc5ed64..6277e65b2d 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -41,6 +41,7 @@ #include "lltrans.h" #include "llui.h" // LLUI::getLanguage() #include "message.h" +#include "llappviewer.h" LLAvatarPropertiesProcessor::LLAvatarPropertiesProcessor() { @@ -367,7 +368,11 @@ void LLAvatarPropertiesProcessor::requestAvatarPropertiesCoro(std::string cap_ur avatar_data.picks_list.emplace_back(pick_data["id"].asUUID(), pick_data["name"].asString()); } - inst.notifyObservers(avatar_id, &avatar_data, type); + LLAppViewer::instance()->postToMainCoro( + [avatar_id, avatar_data, type]() + { + LLAvatarPropertiesProcessor::instance().notifyObservers(avatar_id, (void*) &avatar_data, type); + }); } void LLAvatarPropertiesProcessor::processAvatarLegacyPropertiesReply(LLMessageSystem* msg, void**) From 97826b555b74044887b765e7a029e2763ea86308 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 2 Dec 2024 21:22:04 +0200 Subject: [PATCH 6/8] viewer#3169 Legacy settings should no longer be automatically converted --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloatereditextdaycycle.cpp | 4 +++- indra/newview/llfloaterenvironmentadjust.cpp | 4 ++-- indra/newview/llfloaterfixedenvironment.cpp | 2 ++ indra/newview/llpaneleditsky.cpp | 2 +- indra/newview/llreflectionmapmanager.cpp | 2 +- indra/newview/llsettingsvo.cpp | 2 +- indra/newview/pipeline.cpp | 6 +++--- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6d6a52a77f..07298fa921 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9185,7 +9185,7 @@ Type Boolean Value - 1 + 0 RenderSkyAutoAdjustAmbientScale diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index fd58cd8aaf..42307dd3f8 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1712,6 +1712,7 @@ void LLFloaterEditExtDayCycle::onPickerCommitSetting(LLUUID item_id, S32 track) void LLFloaterEditExtDayCycle::showHDRNotification(const LLSettingsDay::ptr_t &pday) { + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); for (U32 i = LLSettingsDay::TRACK_GROUND_LEVEL; i <= LLSettingsDay::TRACK_MAX; i++) { LLSettingsDay::CycleTrack_t &day_track = pday->getCycleTrack(i); @@ -1722,7 +1723,8 @@ void LLFloaterEditExtDayCycle::showHDRNotification(const LLSettingsDay::ptr_t &p while (iter != end) { LLSettingsSky::ptr_t sky = std::static_pointer_cast(iter->second); - if (sky + if (should_auto_adjust() + && sky && sky->canAutoAdjust() && sky->getReflectionProbeAmbiance(true) != 0.f) { diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 3b8a25b3a6..35f8340997 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -178,7 +178,7 @@ void LLFloaterEnvironmentAdjust::refresh() getChild(FIELD_SKY_CLOUD_MAP)->setValue(mLiveSky->getCloudNoiseTextureId()); getChild(FIELD_WATER_NORMAL_MAP)->setValue(mLiveWater->getNormalMapID()); - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); getChild(FIELD_REFLECTION_PROBE_AMBIANCE)->setValue(mLiveSky->getReflectionProbeAmbiance(should_auto_adjust)); LLColor3 glow(mLiveSky->getGlow()); @@ -494,7 +494,7 @@ void LLFloaterEnvironmentAdjust::updateGammaLabel() { if (!mLiveSky) return; - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); F32 ambiance = mLiveSky->getReflectionProbeAmbiance(should_auto_adjust); if (ambiance != 0.f) { diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index e44202312b..d28c987414 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -182,8 +182,10 @@ void LLFloaterFixedEnvironment::setEditSettingsAndUpdate(const LLSettingsBase::p LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); // teach user about HDR settings + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); if (mSettings && mSettings->getSettingsType() == "sky" + && should_auto_adjust() && ((LLSettingsSky*)mSettings.get())->canAutoAdjust() && ((LLSettingsSky*)mSettings.get())->getReflectionProbeAmbiance(true) != 0.f) { diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index ea2b2ba944..3d376251ff 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -209,7 +209,7 @@ void LLPanelSettingsSkyAtmosTab::refresh() F32 droplet_radius = mSkySettings->getSkyDropletRadius(); F32 ice_level = mSkySettings->getSkyIceLevel(); - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); F32 rp_ambiance = mSkySettings->getReflectionProbeAmbiance(should_auto_adjust); getChild(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setValue(moisture_level); diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 8695022147..232b0b1cdf 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -1070,7 +1070,7 @@ void LLReflectionMapManager::updateUniforms() LLEnvironment& environment = LLEnvironment::instance(); LLSettingsSky::ptr_t psky = environment.getCurrentSky(); - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); F32 minimum_ambiance = psky->getReflectionProbeAmbiance(should_auto_adjust); bool is_ambiance_pass = gCubeSnapshot && !isRadiancePass(); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 85e2f4db90..cf96072ae2 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -795,7 +795,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) F32 g = getGamma(); static LLCachedControl hdr(gSavedSettings, "RenderHDREnabled"); - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); static LLCachedControl auto_adjust_ambient_scale(gSavedSettings, "RenderSkyAutoAdjustAmbientScale", 0.75f); static LLCachedControl auto_adjust_hdr_scale(gSavedSettings, "RenderSkyAutoAdjustHDRScale", 2.f); static LLCachedControl auto_adjust_blue_horizon_scale(gSavedSettings, "RenderSkyAutoAdjustBlueHorizonScale", 1.f); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6c8fe60776..a86c69b924 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7142,7 +7142,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) // Apply gamma correction to the frame here. - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); @@ -7192,7 +7192,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) LLGLDepthTest depth(GL_FALSE, GL_FALSE); static LLCachedControl buildNoPost(gSavedSettings, "RenderDisablePostProcessing", false); - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); LLGLSLShader& shader = psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f ? gLegacyPostGammaCorrectProgram : @@ -8318,7 +8318,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ } // auto adjust legacy sun color if needed - static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); static LLCachedControl auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); LLColor3 sun_diffuse(mSunDiffuse.mV); From ae9174ffdf340ef12c80547d90d05919957ab512 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 10 Dec 2024 13:28:50 -0800 Subject: [PATCH 7/8] #3234 Fix for slightly transparent objects negating colors (#3259) --- indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 02aaf24194..3e702f26be 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -308,6 +308,7 @@ void main() final_scale = 1; #endif - frag_color = max(color * final_scale, vec4(0)); + color.rgb *= final_scale; + frag_color = max(color, vec4(0)); } From d17fd56dc42fcd35ef8cf2fe9e4cd7a26ce8ba2a Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 20:21:24 -0500 Subject: [PATCH 8/8] Fix crashes from shader load failures under RenderMaxOpenGLVersion 3.1/3.2/3.3 (#3184) --- indra/llrender/llshadermgr.cpp | 3 +- .../llfloaterpreferencesgraphicsadvanced.cpp | 21 ++++--- indra/newview/llviewershadermgr.cpp | 59 ++++++++++++++++++- indra/newview/pipeline.cpp | 9 ++- 4 files changed, 77 insertions(+), 15 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 47f1032c34..254ead2bd8 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -580,7 +580,8 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } else { - if (type == GL_GEOMETRY_SHADER) + // OpenGL 3.2 had GLSL version 1.50. anything after that the version numbers match. + if (type == GL_GEOMETRY_SHADER || minor_version >= 50) { //set version to 1.50 shader_code_text[shader_code_count++] = strdup("#version 150\n"); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index cf5b2d033b..8e8967ee3d 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -63,17 +63,24 @@ LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() bool LLFloaterPreferenceGraphicsAdvanced::postBuild() { - // Don't do this on Mac as their braindead GL versioning - // sets this when 8x and 16x are indeed available + // Disable FSAA combo when shaders are not loaded // -#if !LL_DARWIN - if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) - { //remove FSAA settings above "4x" + { LLComboBox* combo = getChild("fsaa"); - combo->remove("8x"); - combo->remove("16x"); + if (!gFXAAProgram[0].isComplete()) + combo->remove("FXAA"); + + if (!gSMAAEdgeDetectProgram[0].isComplete()) + combo->remove("SMAA"); + + if (!gFXAAProgram[0].isComplete() && !gSMAAEdgeDetectProgram[0].isComplete()) + { + combo->setEnabled(false); + getChild("fsaa quality")->setEnabled(false); + } } +#if !LL_DARWIN LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); use_HiDPI->setVisible(false); #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7ce9c02e8d..5b4648a0bf 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2512,6 +2512,7 @@ bool LLViewerShaderMgr::loadShadersDeferred() {"28", "High"}, {"39", "Ultra"} }; int i = 0; + bool failed = false; for (const auto& quality_pair : quality_levels) { if (success) @@ -2535,10 +2536,26 @@ bool LLViewerShaderMgr::loadShadersDeferred() gFXAAProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gFXAAProgram[i].createShader(); - llassert(success); + // llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << gFXAAProgram[i].mName << "', disabling!" << LL_ENDL; + // continue as if this shader never happened + failed = true; + success = true; + break; + } } ++i; } + + if (failed) + { + for (auto i = 0; i < 4; ++i) + { + gFXAAProgram[i].unload(); + } + } } if (gGLManager.mGLVersion > 3.15f && success) @@ -2546,8 +2563,9 @@ bool LLViewerShaderMgr::loadShadersDeferred() std::vector> quality_levels = { {"SMAA_PRESET_LOW", "Low"}, {"SMAA_PRESET_MEDIUM", "Medium"}, {"SMAA_PRESET_HIGH", "High"}, - {"SMAA_PRESET_ULTRA", "Ultra"} }; + {"SMAA_PRESET_ULTRA", "Ultra"} }; int i = 0; + bool failed = false; for (const auto& smaa_pair : quality_levels) { std::map defines; @@ -2576,6 +2594,15 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAAEdgeDetectProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); gSMAAEdgeDetectProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAAEdgeDetectProgram[i].createShader(); + // llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << gSMAAEdgeDetectProgram[i].mName << "', disabling!" << LL_ENDL; + // continue as if this shader never happened + failed = true; + success = true; + break; + } } if (success) @@ -2593,6 +2620,15 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAABlendWeightsProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); gSMAABlendWeightsProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAABlendWeightsProgram[i].createShader(); + // llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << gSMAABlendWeightsProgram[i].mName << "', disabling!" << LL_ENDL; + // continue as if this shader never happened + failed = true; + success = true; + break; + } } if (success) @@ -2610,9 +2646,28 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAANeighborhoodBlendProgram[i].mShaderFiles.push_back(make_pair("deferred/SMAA.glsl", GL_VERTEX_SHADER_ARB)); gSMAANeighborhoodBlendProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gSMAANeighborhoodBlendProgram[i].createShader(); + // llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << gSMAANeighborhoodBlendProgram[i].mName << "', disabling!" << LL_ENDL; + // continue as if this shader never happened + failed = true; + success = true; + break; + } } ++i; } + + if (failed) + { + for (auto i = 0; i < 4; ++i) + { + gSMAAEdgeDetectProgram[i].unload(); + gSMAABlendWeightsProgram[i].unload(); + gSMAANeighborhoodBlendProgram[i].unload(); + } + } } if (success && gGLManager.mGLVersion > 4.05f) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a86c69b924..1ca67dd88a 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7396,8 +7396,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { { llassert(!gCubeSnapshot); - bool multisample = RenderFSAAType == 1 && mFXAAMap.isComplete(); - LLGLSLShader* shader = &gGlowCombineProgram; + bool multisample = RenderFSAAType == 1 && gFXAAProgram[0].isComplete() && mFXAAMap.isComplete(); // Present everything. if (multisample) @@ -7410,7 +7409,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) mFXAAMap.bindTarget(); mFXAAMap.clear(GL_COLOR_BUFFER_BIT); - shader = &gGlowCombineFXAAProgram; + LLGLSLShader* shader = &gGlowCombineFXAAProgram; shader->bind(); S32 channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); @@ -7481,7 +7480,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::generateSMAABuffers(LLRenderTarget* src) { llassert(!gCubeSnapshot); - bool multisample = RenderFSAAType == 2 && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); + bool multisample = RenderFSAAType == 2 && gSMAAEdgeDetectProgram[0].isComplete() && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); // Present everything. if (multisample) @@ -7599,7 +7598,7 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) void LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst) { llassert(!gCubeSnapshot); - bool multisample = RenderFSAAType == 2 && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); + bool multisample = RenderFSAAType == 2 && gSMAAEdgeDetectProgram[0].isComplete() && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); // Present everything. if (multisample)