diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index f30c8c3068..f8df81368f 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -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; } diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 4c635fd946..801fafff4b 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -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); diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 83307b4918..422cfbf1ea 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -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); + } + } // try to load given glyph, if that fails, fallback to ?. This can happen with invalid unicode codepoints. if (FT_Err_Ok != error) diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 77aeea4e8a..c45af66789 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -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; diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index 5dfa196cf6..a975b1f121 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -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) { diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 718365af53..82ccca2600 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -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; } } diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index cf96072ae2..6f9d4a24bc 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -807,7 +807,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) static LLCachedControl 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) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a0202677c1..eb7512cc73 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2202,7 +2202,7 @@ bool idle_startup() // by the voice's events // [FS communication UI] //LLFloaterIMContainer *im_inst = LLFloaterIMContainer::getInstance(); - //if(gAgent.isFirstLogin()) + //if(gAgent.isFirstLogin() && im_inst) //{ // im_inst->openFloater(im_inst->getKey()); //} diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 04d7681f4d..5c084c2868 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -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); + } } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2e136b0c8f..dd3016f57f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -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 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);