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

# Conflicts:
#	indra/llrender/llfontfreetype.cpp
#	indra/newview/llstartup.cpp
master
Ansariel 2025-01-07 13:56:32 +01:00
commit 926c22e1b9
10 changed files with 81 additions and 39 deletions

View File

@ -2036,43 +2036,43 @@ F32 LLSettingsSky::getGamma() const
return mGamma;
}
F32 LLSettingsSky::getHDRMin() const
F32 LLSettingsSky::getHDRMin(bool auto_adjust) const
{
if (mCanAutoAdjust)
if (mCanAutoAdjust && !auto_adjust)
return 0.f;
return mHDRMin;
}
F32 LLSettingsSky::getHDRMax() const
F32 LLSettingsSky::getHDRMax(bool auto_adjust) const
{
if (mCanAutoAdjust)
if (mCanAutoAdjust && !auto_adjust)
return 0.f;
return mHDRMax;
}
F32 LLSettingsSky::getHDROffset() const
F32 LLSettingsSky::getHDROffset(bool auto_adjust) const
{
if (mCanAutoAdjust)
if (mCanAutoAdjust && !auto_adjust)
return 1.0f;
return mHDROffset;
}
F32 LLSettingsSky::getTonemapMix() const
F32 LLSettingsSky::getTonemapMix(bool auto_adjust) const
{
if (mCanAutoAdjust)
if (mCanAutoAdjust && !auto_adjust)
{
// legacy settings do not support tonemaping
return 0.0f;
}
return mTonemapMix;
}
void LLSettingsSky::setTonemapMix(F32 mix)
{
if (mCanAutoAdjust)
return;
mTonemapMix = mix;
}

View File

@ -209,10 +209,10 @@ public:
F32 getGamma() const;
F32 getHDRMin() const;
F32 getHDRMax() const;
F32 getHDROffset() const;
F32 getTonemapMix() const;
F32 getHDRMin(bool auto_adjust = false) const;
F32 getHDRMax(bool auto_adjust = false) const;
F32 getHDROffset(bool auto_adjust = false) const;
F32 getTonemapMix(bool auto_adjust = false) const;
void setTonemapMix(F32 mix);
void setGamma(F32 val);

View File

@ -649,7 +649,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l
return NULL;
llassert(!mIsFallback);
fontp->renderGlyph(requested_glyph_type, glyph_index);
fontp->renderGlyph(requested_glyph_type, glyph_index, wch);
EFontGlyphType bitmap_glyph_type = EFontGlyphType::Unspecified;
switch (fontp->mFTFace->glyph->bitmap.pixel_mode)
@ -794,7 +794,7 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const
}
}
void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index) const
void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, llwchar wch) const
{
if (mFTFace == NULL)
return;
@ -809,11 +809,28 @@ void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index) co
FT_Error error = FT_Load_Glyph(mFTFace, glyph_index, load_flags);
if (FT_Err_Ok != error)
{
if (error == FT_Err_Out_Of_Memory)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Out of memory loading glyph for character " << wch << LL_ENDL;
}
std::string message = llformat(
"Error %d (%s) loading glyph %u: bitmap_type=%u, load_flags=%d",
error, FT_Error_String(error), glyph_index, bitmap_type, load_flags);
"Error %d (%s) loading wchar %u glyph %u/%u: bitmap_type=%u, load_flags=%d",
error, FT_Error_String(error), wch, glyph_index, mFTFace->num_glyphs, bitmap_type, load_flags);
LL_WARNS_ONCE() << message << LL_ENDL;
error = FT_Load_Glyph(mFTFace, glyph_index, load_flags ^ FT_LOAD_COLOR);
if (FT_Err_Invalid_Outline == error
|| FT_Err_Invalid_Composite == error
|| (FT_Err_Ok != error && LLStringOps::isEmoji(wch)))
{
glyph_index = FT_Get_Char_Index(mFTFace, '?');
// if '?' is not present, potentially can use last index, that's supposed to be null glyph
if (glyph_index > 0)
{
error = FT_Load_Glyph(mFTFace, glyph_index, load_flags ^ FT_LOAD_COLOR);
}
}
// <FS:ND> try to load given glyph, if that fails, fallback to ?. This can happen with invalid unicode codepoints.
if (FT_Err_Ok != error)

View File

@ -174,7 +174,7 @@ private:
bool hasGlyph(llwchar wch) const; // Has a glyph for this character
LLFontGlyphInfo* addGlyph(llwchar wch, EFontGlyphType glyph_type) const; // Add a new character to the font if necessary
LLFontGlyphInfo* addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index, EFontGlyphType bitmap_type) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found)
void renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index) const;
void renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, llwchar wch) const;
void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const;
std::string mName;

View File

@ -38,6 +38,8 @@ uniform float max_probe_lod;
uniform bool transparent_surface;
uniform int classic_mode;
#define MAX_REFMAP_COUNT 256 // must match LL_MAX_REFLECTION_PROBE_COUNT
layout (std140) uniform ReflectionProbes
@ -739,7 +741,10 @@ void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
ambenv = sampleProbeAmbient(pos, norm, amblit);
ambenv = amblit;
if (classic_mode == 0)
ambenv = sampleProbeAmbient(pos, norm, amblit);
float lod = (1.0-glossiness)*reflection_lods;
glossenv = sampleProbes(pos, normalize(refnormpersp), lod);
@ -845,7 +850,10 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
ambenv = sampleProbeAmbient(pos, norm, amblit);
ambenv = amblit;
if (classic_mode == 0)
ambenv = sampleProbeAmbient(pos, norm, amblit);
if (glossiness > 0.0)
{

View File

@ -183,6 +183,7 @@ void LLPanelContents::onFilterEdit()
}
else
{
LLFolderView* root_folder = mPanelInventoryObject->getRootFolder();
if (filter_substring.empty())
{
if (mPanelInventoryObject->getFilter().getFilterSubString().empty())
@ -193,19 +194,28 @@ void LLPanelContents::onFilterEdit()
if (mDirtyFilter && !mSavedFolderState.hasOpenFolders())
{
mPanelInventoryObject->getRootFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::ERecurseType::RECURSE_DOWN);
if (root_folder)
{
root_folder->setOpenArrangeRecursively(true, LLFolderViewFolder::ERecurseType::RECURSE_DOWN);
}
}
else
{
mSavedFolderState.setApply(true);
mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
if (root_folder)
{
root_folder->applyFunctorRecursively(mSavedFolderState);
}
}
mDirtyFilter = false;
// Add a folder with the current item to the list of previously opened folders
LLOpenFoldersWithSelection opener;
mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(opener);
mPanelInventoryObject->getRootFolder()->scrollToShowSelection();
if (root_folder)
{
LLOpenFoldersWithSelection opener;
root_folder->applyFunctorRecursively(opener);
root_folder->scrollToShowSelection();
}
}
else if (mPanelInventoryObject->getFilter().getFilterSubString().empty())
{
@ -213,7 +223,10 @@ void LLPanelContents::onFilterEdit()
if (!mPanelInventoryObject->getFilter().isNotDefault())
{
mSavedFolderState.setApply(false);
mPanelInventoryObject->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
if (root_folder)
{
root_folder->applyFunctorRecursively(mSavedFolderState);
}
mDirtyFilter = false;
}
}

View File

@ -807,7 +807,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f);
// sky is a "classic" sky following pre SL 7.0 shading
bool classic_mode = psky->canAutoAdjust();
bool classic_mode = psky->canAutoAdjust() && !should_auto_adjust();
if (!classic_mode)
{

View File

@ -2202,7 +2202,7 @@ bool idle_startup()
// by the voice's events
// <FS:Ansariel> [FS communication UI]
//LLFloaterIMContainer *im_inst = LLFloaterIMContainer::getInstance();
//if(gAgent.isFirstLogin())
//if(gAgent.isFirstLogin() && im_inst)
//{
// im_inst->openFloater(im_inst->getKey());
//}

View File

@ -773,8 +773,12 @@ void LLVOVolume::animateTextures()
// LLVOVolume::updateTextureVirtualSize when the
// mTextureMatrix is not yet present
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_TCOORD);
mDrawable->getSpatialGroup()->dirtyGeom();
gPipeline.markRebuild(mDrawable->getSpatialGroup());
LLSpatialGroup* group = mDrawable->getSpatialGroup();
if (group)
{
group->dirtyGeom();
gPipeline.markRebuild(group);
}
}
}

View File

@ -7243,7 +7243,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
LLSettingsSky::ptr_t sky = LLEnvironment::instance().getCurrentSky();
F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust);
F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust());
F32 exp_min = 1.f;
F32 exp_max = 1.f;
@ -7254,13 +7254,13 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
{
if (dynamic_exposure_enabled)
{
exp_min = sky->getHDROffset() - sky->getHDRMin();
exp_max = sky->getHDROffset() + sky->getHDRMax();
exp_min = sky->getHDROffset(should_auto_adjust()) - sky->getHDRMin(should_auto_adjust());
exp_max = sky->getHDROffset(should_auto_adjust()) + sky->getHDRMax(should_auto_adjust());
}
else
{
exp_min = sky->getHDROffset();
exp_max = sky->getHDROffset();
exp_min = sky->getHDROffset(should_auto_adjust());
exp_max = sky->getHDROffset(should_auto_adjust());
}
}
else if (dynamic_exposure_enabled)
@ -7280,7 +7280,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
shader->uniform1f(dt, gFrameIntervalSeconds);
shader->uniform2f(noiseVec, ll_frand() * 2.0f - 1.0f, ll_frand() * 2.0f - 1.0f);
shader->uniform4f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max, dynamic_exposure_speed_error);
shader->uniform4f(dynamic_exposure_params2, sky->getHDROffset(), exp_min, exp_max, dynamic_exposure_speed_target);
shader->uniform4f(dynamic_exposure_params2, sky->getHDROffset(should_auto_adjust()), exp_min, exp_max, dynamic_exposure_speed_target);
mScreenTriangleVB->setBuffer();
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
@ -7338,7 +7338,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
static LLCachedControl<U32> tonemap_type_setting(gSavedSettings, "RenderTonemapType", 0U);
shader.uniform1i(tonemap_type, tonemap_type_setting);
shader.uniform1f(tonemap_mix, psky->getTonemapMix());
shader.uniform1f(tonemap_mix, psky->getTonemapMix(should_auto_adjust()));
mScreenTriangleVB->setBuffer();
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);