Merge branch 'release/2024.09-ExtraFPS' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/newview/skins/default/xui/en/notifications.xml
master
Ansariel 2024-12-11 17:47:28 +01:00
commit 586d0a3247
19 changed files with 125 additions and 97 deletions

View File

@ -586,7 +586,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");

View File

@ -48,6 +48,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)
{

View File

@ -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);
@ -116,8 +117,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

View File

@ -12731,7 +12731,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
<integer>0</integer>
</map>
<key>RenderSkyAutoAdjustAmbientScale</key>
<map>

View File

@ -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));
}

View File

@ -1234,53 +1234,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())

View File

@ -41,6 +41,7 @@
#include "lltrans.h"
#include "llui.h" // LLUI::getLanguage()
#include "message.h"
#include "llappviewer.h"
LLAvatarPropertiesProcessor::LLAvatarPropertiesProcessor()
{
@ -418,7 +419,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**)

View File

@ -1712,6 +1712,7 @@ void LLFloaterEditExtDayCycle::onPickerCommitSetting(LLUUID item_id, S32 track)
void LLFloaterEditExtDayCycle::showHDRNotification(const LLSettingsDay::ptr_t &pday)
{
static LLCachedControl<bool> 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<LLSettingsSky>(iter->second);
if (sky
if (should_auto_adjust()
&& sky
&& sky->canAutoAdjust()
&& sky->getReflectionProbeAmbiance(true) != 0.f)
{

View File

@ -178,7 +178,7 @@ void LLFloaterEnvironmentAdjust::refresh()
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setValue(mLiveSky->getCloudNoiseTextureId());
getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setValue(mLiveWater->getNormalMapID());
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
getChild<LLUICtrl>(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<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
F32 ambiance = mLiveSky->getReflectionProbeAmbiance(should_auto_adjust);
if (ambiance != 0.f)
{

View File

@ -182,8 +182,10 @@ void LLFloaterFixedEnvironment::setEditSettingsAndUpdate(const LLSettingsBase::p
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
// teach user about HDR settings
static LLCachedControl<bool> 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)
{

View File

@ -3870,17 +3870,24 @@ bool LLPanelPreferenceGraphics::postBuild()
// </FS:Ansariel>
// <FS:Ansariel> Advanced graphics preferences
// Don't do this on Mac as their braindead GL versioning
// sets this when 8x and 16x are indeed available
//
#if !LL_DARWIN
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
{ //remove FSAA settings above "4x"
// Disable FSAA combo when shaders are not loaded
//
{
LLComboBox* combo = getChild<LLComboBox>("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<LLComboBox>("fsaa quality")->setEnabled(false);
}
}
#if !LL_DARWIN
LLCheckBoxCtrl *use_HiDPI = getChild<LLCheckBoxCtrl>("use HiDPI");
use_HiDPI->setEnabled(false);
#endif

View File

@ -64,17 +64,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<LLComboBox>("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<LLComboBox>("fsaa quality")->setEnabled(false);
}
}
#if !LL_DARWIN
LLCheckBoxCtrl *use_HiDPI = getChild<LLCheckBoxCtrl>("use HiDPI");
use_HiDPI->setVisible(false);
#endif

View File

@ -209,7 +209,7 @@ void LLPanelSettingsSkyAtmosTab::refresh()
F32 droplet_radius = mSkySettings->getSkyDropletRadius();
F32 ice_level = mSkySettings->getSkyIceLevel();
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
F32 rp_ambiance = mSkySettings->getReflectionProbeAmbiance(should_auto_adjust);
getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->setValue(moisture_level);

View File

@ -1070,7 +1070,7 @@ void LLReflectionMapManager::updateUniforms()
LLEnvironment& environment = LLEnvironment::instance();
LLSettingsSky::ptr_t psky = environment.getCurrentSky();
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
F32 minimum_ambiance = psky->getReflectionProbeAmbiance(should_auto_adjust);
bool is_ambiance_pass = gCubeSnapshot && !isRadiancePass();

View File

@ -795,7 +795,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
F32 g = getGamma();
static LLCachedControl<bool> hdr(gSavedSettings, "RenderHDREnabled");
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
static LLCachedControl<F32> auto_adjust_ambient_scale(gSavedSettings, "RenderSkyAutoAdjustAmbientScale", 0.75f);
static LLCachedControl<F32> auto_adjust_hdr_scale(gSavedSettings, "RenderSkyAutoAdjustHDRScale", 2.f);
static LLCachedControl<F32> auto_adjust_blue_horizon_scale(gSavedSettings, "RenderSkyAutoAdjustBlueHorizonScale", 1.f);

View File

@ -2532,6 +2532,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
{"28", "High"},
{"39", "Ultra"} };
int i = 0;
bool failed = false;
for (const auto& quality_pair : quality_levels)
{
if (success)
@ -2555,10 +2556,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)
@ -2566,8 +2583,9 @@ bool LLViewerShaderMgr::loadShadersDeferred()
std::vector<std::pair<std::string, std::string>> 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<std::string, std::string> defines;
@ -2596,6 +2614,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)
@ -2613,6 +2640,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)
@ -2630,9 +2666,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)
@ -2831,7 +2886,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);

View File

@ -7284,7 +7284,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
// Apply gamma correction to the frame here.
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
@ -7334,7 +7334,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst)
LLGLDepthTest depth(GL_FALSE, GL_FALSE);
static LLCachedControl<bool> buildNoPost(gSavedSettings, "RenderDisablePostProcessing", false);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
LLGLSLShader& shader = psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f ? gLegacyPostGammaCorrectProgram :
@ -7538,8 +7538,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)
@ -7552,7 +7551,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());
@ -7623,7 +7622,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)
@ -7741,7 +7740,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)
@ -8535,7 +8534,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
}
// auto adjust legacy sun color if needed
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true);
static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false);
static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f);
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
LLColor3 sun_diffuse(mSunDiffuse.mV);

View File

@ -10852,12 +10852,6 @@ Do you wish to continue?
yestext="OK"/>
</notification>
<global name="UnsupportedIntelDriver">
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?
</global>
<global name="UnsupportedCPUAmount">
796
</global>

View File

@ -4037,11 +4037,6 @@ Czy chcesz kontynuować?
Wybrany obiekt ma wpływ na Navmesh. Dodanie elastyczności spowoduje usunięcie go z Navmesha.
<usetemplate ignoretext="Wybrany obiekt ma wpływ na Navmesh. Dodanie elastyczności spowoduje usunięcie go z Navmesha." name="okcancelignore" notext="Anuluj" />
</notification>
<global name="UnsupportedIntelDriver">
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?
</global>
<global name="UnsupportedGPU">
- Twoja karta graficzna nie spełnia minimalnych wymagań.
</global>