Merge branch 'release/2024.12-ForeverFPS' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/newview/llappviewer.cpp
#	indra/newview/llviewerobjectlist.cpp
#	indra/newview/skins/default/xui/en/panel_preferences_setup.xml
#	indra/newview/skins/default/xui/ja/panel_preferences_setup.xml
master
Ansariel 2025-02-03 16:11:21 +01:00
commit dac7725c40
10 changed files with 134 additions and 100 deletions

View File

@ -37,7 +37,12 @@ jobs:
- name: Update Tag
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# use a real access token instead of GITHUB_TOKEN default.
# required so that the results of this tag creation can trigger the build workflow
# https://stackoverflow.com/a/71372524
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
# this token will need to be renewed anually in January
github-token: ${{ secrets.LL_TAG_RELEASE_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,

View File

@ -320,6 +320,7 @@ namespace LLError
class LLUserWarningMsg
{
public:
// error codes, tranlates to last_exec states like LAST_EXEC_OTHER_CRASH
typedef enum
{
ERROR_OTHER = 0,

View File

@ -16874,7 +16874,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>UpdaterWillingToTest</key>
<map>
<key>Comment</key>
<string>Whether or not the updater should offer test candidate upgrades.</string>
<string>Whether or not the updater should offer Beta upgrades.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@ -41,6 +41,26 @@ vec3 srgb_to_linear(vec3 cs)
}
vec4 srgb_to_linear4(vec4 cs)
{
vec4 low_range = cs / vec4(12.92);
vec4 high_range = pow((cs+vec4(0.055))/vec4(1.055), vec4(2.4));
bvec4 lte = lessThanEqual(cs,vec4(0.04045));
#ifdef OLD_SELECT
vec4 result;
result.r = lte.r ? low_range.r : high_range.r;
result.g = lte.g ? low_range.g : high_range.g;
result.b = lte.b ? low_range.b : high_range.b;
result.a = lte.a ? low_range.a : high_range.a;
return result;
#else
return mix(high_range, low_range, lte);
#endif
}
vec3 linear_to_srgb(vec3 cl)
{
cl = clamp(cl, vec3(0), vec3(1));

View File

@ -66,11 +66,11 @@ vec4 getWaterFogViewNoClip(vec3 pos)
float t2 = kd + ks * es;
float t3 = pow(F, t2*l) - 1.0;
float L = min(t1/t2*t3, 1.0);
float L = pow(min(t1/t2*t3, 1.0), 1.0/1.7);
float D = pow(0.98, l*kd);
return vec4(srgb_to_linear(kc.rgb*L), D);
return vec4(srgb_to_linear(kc.rgb)*L, D);
}
vec4 getWaterFogView(vec3 pos)

View File

@ -56,7 +56,7 @@ void main()
vec4 pos = getPositionWithDepth(tc, depth);
vec4 fogged = getWaterFogView(pos.xyz);
fogged.a = max(pow(fogged.a, 1.7), 0);
frag_color = max(fogged, vec4(0)); //output linear since local lights will be added to this shader's results
}

View File

@ -132,8 +132,54 @@ vec3 transform_normal(vec3 vNt)
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, vec3 amblit_linear);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit);
vec3 getPositionWithNDC(vec3 ndc);
void generateWaveNormals(out vec3 wave1, out vec3 wave2, out vec3 wave3)
{
// Generate all of our wave normals.
// We layer these back and forth.
vec2 bigwave = vec2(refCoord.w, view.w);
vec3 wave1_a = texture(bumpMap, bigwave, -2).xyz * 2.0 - 1.0;
vec3 wave2_a = texture(bumpMap, littleWave.xy).xyz * 2.0 - 1.0;
vec3 wave3_a = texture(bumpMap, littleWave.zw).xyz * 2.0 - 1.0;
vec3 wave1_b = texture(bumpMap2, bigwave).xyz * 2.0 - 1.0;
vec3 wave2_b = texture(bumpMap2, littleWave.xy).xyz * 2.0 - 1.0;
vec3 wave3_b = texture(bumpMap2, littleWave.zw).xyz * 2.0 - 1.0;
wave1 = BlendNormal(wave1_a, wave1_b);
wave2 = BlendNormal(wave2_a, wave2_b);
wave3 = BlendNormal(wave3_a, wave3_b);
}
void calculateFresnelFactors(out vec3 df3, out vec2 df2, vec3 viewVec, vec3 wave1, vec3 wave2, vec3 wave3, vec3 wavef)
{
// We calculate the fresnel here.
// We do this by getting the dot product for each sets of waves, and applying scale and offset.
df3 = vec3(
dot(viewVec, wave1),
dot(viewVec, (wave2 + wave3) * 0.5),
dot(viewVec, wave3)
) * fresnelScale + fresnelOffset;
df3 *= df3;
df2 = vec2(
df3.x + df3.y + df3.z,
dot(viewVec, wavef) * fresnelScale + fresnelOffset
);
}
void main()
{
mirrorClip(vary_position);
@ -148,30 +194,23 @@ void main()
//normalize view vector
vec3 viewVec = normalize(pos.xyz);
//get wave normals
vec2 bigwave = vec2(refCoord.w, view.w);
vec3 wave1_a = texture(bumpMap, bigwave, -2 ).xyz*2.0-1.0;
vec3 wave2_a = texture(bumpMap, littleWave.xy).xyz*2.0-1.0;
vec3 wave3_a = texture(bumpMap, littleWave.zw).xyz*2.0-1.0;
// Setup our waves.
vec3 wave1_b = texture(bumpMap2, bigwave ).xyz*2.0-1.0;
vec3 wave2_b = texture(bumpMap2, littleWave.xy).xyz*2.0-1.0;
vec3 wave3_b = texture(bumpMap2, littleWave.zw).xyz*2.0-1.0;
vec3 wave1 = vec3(0, 0, 1);
vec3 wave2 = vec3(0, 0, 1);
vec3 wave3 = vec3(0, 0, 1);
//wave1_a = wave2_a = wave3_a = wave1_b = wave2_b = wave3_b = vec3(0,0,1);
vec3 wave1 = BlendNormal(wave1_a, wave1_b);
vec3 wave2 = BlendNormal(wave2_a, wave2_b);
vec3 wave3 = BlendNormal(wave3_a, wave3_b);
generateWaveNormals(wave1, wave2, wave3);
vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5;
//wave1 = transform_normal(wave1);
//wave2 = transform_normal(wave2);
//wave3 = transform_normal(wave3);
vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5;
vec3 df3 = vec3(0);
vec2 df2 = vec2(0);
calculateFresnelFactors(df3, df2, normalize(view.xyz), wave1, wave2, wave3, wavef);
vec3 waver = wavef*3;
vec3 up = transform_normal(vec3(0,0,1));
@ -197,7 +236,7 @@ void main()
float dmod = sqrt(dist);
//figure out distortion vector (ripply)
vec2 distort2 = distort + waver.xy * refScale / max(dmod, 1.0);
vec2 distort2 = distort + waver.xy * refScale / max(dmod, 1.0) * 2;
distort2 = clamp(distort2, vec2(0), vec2(0.999));
@ -217,8 +256,8 @@ void main()
vec3 sunlit_linear = srgb_to_linear(sunlit);
#ifdef TRANSPARENT_WATER
vec4 fb = texture(screenTex, distort2);
float depth = texture(depthMap, distort2).r;
vec4 fb = texture(screenTex, distort2);
vec3 refPos = getPositionWithNDC(vec3(distort2*2.0-vec2(1.0), depth*2.0-1.0));
if (refPos.z > pos.z-0.05)
@ -234,18 +273,16 @@ void main()
vec4 fb = applyWaterFogViewLinear(viewVec*2048.0, vec4(1.0));
#endif
// fudge sample on other side of water to be a tad darker
fb.rgb *= 0.75;
float metallic = 0.0;
float perceptualRoughness = 0.05;
float gloss = 1.0 - perceptualRoughness;
float metallic = 1.0;
float perceptualRoughness = 0.1;
float gloss = 0.95;
vec3 irradiance = vec3(0);
vec3 radiance = vec3(0);
vec3 legacyenv = vec3(0);
sampleReflectionProbesWater(irradiance, radiance, distort2, pos.xyz, wave_ibl.xyz, gloss, amblit);
irradiance = vec3(0);
//sampleReflectionProbes(irradiance, radiance, distort2, pos.xyz, wave_ibl.xyz, 1, true, amblit);
//sampleReflectionProbesLegacy(irradiance, radiance, legacyenv, distort2, pos.xyz, wave_ibl.xyz, gloss, 1, false, amblit);
vec3 diffuseColor = vec3(0);
vec3 specularColor = vec3(0);
@ -257,46 +294,22 @@ void main()
float ao = 1.0;
vec3 light_dir = transform_normal(lightDir);
perceptualRoughness = 0.0;
metallic = 1.0;
float NdotV = clamp(abs(dot(norm, v)), 0.001, 1.0);
float nl = 0;
vec3 diffPunc = vec3(0);
vec3 specPunc = vec3(0);
pbrPunctual(vec3(0), specularColor, 0.1, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc);
pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir), nl, diffPunc, specPunc);
vec3 punctual = clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10));
vec3 punctual = clamp(nl * (diffPunc + specPunc), vec3(0), vec3(10)) * sunlit_linear * 2.75 * shadow;
vec3 color = punctual * sunlit_linear * 2.75 * shadow;
vec3 iblDiff;
vec3 iblSpec;
pbrIbl(vec3(0), vec3(1), radiance, vec3(0), ao, NdotV, 0.0, iblDiff, iblSpec);
vec3 color = vec3(0);
color += iblDiff + iblSpec;
float nv = clamp(abs(dot(norm.xyz, v)), 0.001, 1.0);
vec2 brdf = BRDF(clamp(nv, 0, 1), 1.0);
float f = 1.0-brdf.y; //1.0 - (brdf.x+brdf.y);
f *= 0.9;
f *= f;
// incoming scale is [0, 1] with 0.5 being default
// shift to 0.5 to 1.5
f *= (fresnelScale - 0.5)+1.0;
// incoming offset is [0, 1] with 0.5 being default
// shift from -1 to 1
f += (fresnelOffset - 0.5) * 2.0;
f = clamp(f, 0, 1);
color = ((1.0 - f) * color) + fb.rgb;
color = mix(fb.rgb, radiance * df2.x, df2.x * 0.99999) + punctual.rgb;
float spec = min(max(max(punctual.r, punctual.g), punctual.b), 0.05);
frag_color = max(vec4(color, spec), vec4(0));
frag_color = max(vec4(color.rgb, spec), vec4(0));
}

View File

@ -546,9 +546,14 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
selfStopPhase("update_appearance_on_destroy");
LLAppearanceMgr::instance().updateAppearanceFromCOF(mEnforceItemRestrictions,
mEnforceOrdering,
mPostUpdateFunc);
//avoid calling an update inside coroutine
bool force_restrictions(mEnforceItemRestrictions);
bool enforce_ordering(mEnforceOrdering);
nullary_func_t post_update_func(mPostUpdateFunc);
doOnIdleOneTime([force_restrictions,enforce_ordering,post_update_func]()
{
LLAppearanceMgr::instance().updateAppearanceFromCOF(force_restrictions, enforce_ordering, post_update_func);
});
}
}

View File

@ -424,7 +424,6 @@ const int MAX_MARKER_LENGTH = 1024;
const std::string MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".exec_marker"); //FS orig modified LL
const std::string START_MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".start_marker"); //FS new modified LL new
const std::string ERROR_MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".error_marker"); //FS orig modified LL
const std::string LLERROR_MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".llerror_marker"); //FS orig modified LL
const std::string LOGOUT_MARKER_FILE_NAME(SAFE_FILE_NAME_PREFIX + ".logout_marker"); //FS orig modified LL
//static bool gDoDisconnect = false;
@ -2612,6 +2611,7 @@ bool LLAppViewer::initThreads()
return true;
}
// Callback for all LL_ERROR calls
void errorCallback(LLError::ELevel level, const std::string &error_string)
{
if (level == LLError::LEVEL_ERROR)
@ -2653,9 +2653,18 @@ void errorCallback(LLError::ELevel level, const std::string &error_string)
// haven't actually trashed anything yet, we can afford to write the whole
// static info file.
LLAppViewer::instance()->writeDebugInfo();
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
if (!LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
{
// If marker doesn't exist, create a marker with llerror code for next launch
// otherwise don't override existing file
LLAppViewer::instance()->createErrorMarker(LAST_EXEC_LLERROR_CRASH);
}
}
}
// Callback for LLError::LLUserWarningMsg
void errorHandler(const std::string& title_string, const std::string& message_string, S32 code)
{
if (!message_string.empty())
@ -4725,29 +4734,6 @@ void LLAppViewer::processMarkerFiles()
}
LLAPRFile::remove(logout_marker_file);
}
// further refine based on whether or not a marker created during an llerr crash is found
std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME);
if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB))
{
if (markerIsSameVersion(llerror_marker_file))
{
if ( gLastExecEvent == LAST_EXEC_LOGOUT_FROZE )
{
gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL;
}
else
{
gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LLERROR_CRASH" << LL_ENDL;
}
}
else
{
LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' found, but versions did not match" << LL_ENDL;
}
LLAPRFile::remove(llerror_marker_file);
}
// and last refine based on whether or not a marker created during a non-llerr crash is found
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))

View File

@ -1702,21 +1702,26 @@ void LLViewerObjectList::cleanDeadObjects(bool use_timer)
void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
{
S32 idx = objectp->getListIndex();
if (idx != -1 && mActiveObjects.size() > 0) // <FS:Beq/> FIRE-35090 - Bugsplat on exit when last_index == -1/mActiveObjects.size() == 0
{ //remove by moving last element to this object's position
llassert(mActiveObjects[idx] == objectp);
if (idx != -1)
{
objectp->setListIndex(-1);
S32 last_index = static_cast<S32>(mActiveObjects.size()) - 1;
if (idx != last_index)
S32 size = (S32)mActiveObjects.size();
if (size > 0) // mActiveObjects could have been cleaned already
{
mActiveObjects[idx] = mActiveObjects[last_index];
mActiveObjects[idx]->setListIndex(idx);
}
// Remove by moving last element to this object's position
mActiveObjects.pop_back();
llassert(idx < size); // idx should be always within mActiveObjects, unless killAllObjects was called
llassert(mActiveObjects[idx] == objectp); // object should be there
S32 last_index = size - 1;
if (idx < last_index)
{
mActiveObjects[idx] = mActiveObjects[last_index];
mActiveObjects[idx]->setListIndex(idx);
} // else assume it's the last element, no need to swap
mActiveObjects.pop_back();
}
}
}
@ -1874,7 +1879,6 @@ void LLViewerObjectList::repartitionObjects()
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
LLViewerObject* objectp = *iter;
if (!objectp->isDead())
{
LLDrawable* drawable = objectp->mDrawable;