diff options
22 files changed, 348 insertions, 31 deletions
diff --git a/indra/llrender/llfontvertexbuffer.cpp b/indra/llrender/llfontvertexbuffer.cpp index 963aab7121..5bd1ca5eed 100644 --- a/indra/llrender/llfontvertexbuffer.cpp +++ b/indra/llrender/llfontvertexbuffer.cpp @@ -144,6 +144,8 @@ S32 LLFontVertexBuffer::render( || mLastShadow != shadow // ex: buttons change shadow state || mLastScaleX != LLFontGL::sScaleX || mLastScaleY != LLFontGL::sScaleY + || mLastVertDPI != LLFontGL::sVertDPI + || mLastHorizDPI != LLFontGL::sHorizDPI || mLastOrigin != LLFontGL::sCurOrigin) { genBuffers(fontp, text, begin_offset, x, y, color, halign, valign, @@ -196,6 +198,8 @@ void LLFontVertexBuffer::genBuffers( mLastScaleX = LLFontGL::sScaleX; mLastScaleY = LLFontGL::sScaleY; + mLastVertDPI = LLFontGL::sVertDPI; + mLastHorizDPI = LLFontGL::sHorizDPI; mLastOrigin = LLFontGL::sCurOrigin; if (right_x) diff --git a/indra/llrender/llfontvertexbuffer.h b/indra/llrender/llfontvertexbuffer.h index 59cb536b74..af195dfff9 100644 --- a/indra/llrender/llfontvertexbuffer.h +++ b/indra/llrender/llfontvertexbuffer.h @@ -115,6 +115,8 @@ private: // LLFontGL's statics F32 mLastScaleX = 1.f; F32 mLastScaleY = 1.f; + F32 mLastVertDPI = 0.f; + F32 mLastHorizDPI = 0.f; LLCoordGL mLastOrigin; static bool sEnableBufferCollection; diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index a73962f3d6..e02bf5919b 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -246,10 +246,10 @@ void LLWebRTCImpl::init() apm_config.gain_controller1.enabled = false; apm_config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveAnalog; apm_config.gain_controller2.enabled = false; - apm_config.high_pass_filter.enabled = true; + apm_config.high_pass_filter.enabled = false; apm_config.noise_suppression.enabled = true; apm_config.noise_suppression.level = webrtc::AudioProcessing::Config::NoiseSuppression::kVeryHigh; - apm_config.transient_suppression.enabled = true; + apm_config.transient_suppression.enabled = false; apm_config.pipeline.multi_channel_render = true; apm_config.pipeline.multi_channel_capture = false; @@ -362,14 +362,13 @@ void LLWebRTCImpl::setAudioConfig(LLWebRTCDeviceInterface::AudioConfig config) { webrtc::AudioProcessing::Config apm_config; apm_config.echo_canceller.enabled = config.mEchoCancellation; - apm_config.echo_canceller.mobile_mode = false; + apm_config.echo_canceller.mobile_mode = false; // don't use mobile hardware echo cancellation. apm_config.gain_controller1.enabled = config.mAGC; apm_config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveAnalog; - apm_config.gain_controller2.enabled = false; - apm_config.high_pass_filter.enabled = true; - apm_config.transient_suppression.enabled = true; - apm_config.pipeline.multi_channel_render = true; - apm_config.pipeline.multi_channel_capture = true; + apm_config.gain_controller2.enabled = false; // use the main gain controller. + apm_config.high_pass_filter.enabled = false; // don't filter, to improve quality for music and other pure sources. + apm_config.transient_suppression.enabled = false; // transient suppression may increase latency. + apm_config.pipeline.multi_channel_render = true; // stereo apm_config.pipeline.multi_channel_capture = true; switch (config.mNoiseSuppressionLevel) @@ -750,7 +749,7 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl) } void LLWebRTCPeerConnectionImpl::terminate() { - mWebRTCImpl->SignalingBlockingCall( + mWebRTCImpl->PostSignalingTask( [this]() { if (mPeerConnection) @@ -875,6 +874,13 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti codecparam.parameters["stereo"] = "1"; codecparam.parameters["sprop-stereo"] = "1"; params.codecs.push_back(codecparam); + + // Fixed bitrates result in lower CPU cost + for (auto&& encoding : params.encodings) + { + encoding.max_bitrate_bps = 64000; + encoding.min_bitrate_bps = 64000; + } sender->SetParameters(params); } @@ -959,7 +965,7 @@ void LLWebRTCPeerConnectionImpl::setMute(bool mute) mMute = mute; mute |= mWebRTCImpl->isCaptureNoDevice(); mWebRTCImpl->PostSignalingTask( - [&]() + [this, mute]() { if (mPeerConnection) { @@ -1231,7 +1237,7 @@ void LLWebRTCPeerConnectionImpl::OnSuccess(webrtc::SessionDescriptionInterface * else if (sdp_line.find("a=fmtp:" + opus_payload) == 0) { sdp_mangled_stream << sdp_line << "a=fmtp:" << opus_payload - << " minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1;maxplaybackrate=48000;sprop-maxplaybackrate=48000;sprop-maxcapturerate=48000\n"; + << " minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1;maxplaybackrate=48000;sprop-maxplaybackrate=48000;sprop-maxcapturerate=48000;complexity=4\n"; } else { diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index e695035461..92bcb1a2ae 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -3256,6 +3256,27 @@ std::string LLXMLNode::getTextContents() const return msg; } +std::string LLXMLNode::getXMLRPCTextContents() const +{ + std::string msg; + std::string::size_type start = mValue.find_first_not_of(" \t\n"); + if (start != mValue.npos) + { + std::string::size_type end = mValue.find_last_not_of(" \t\n"); + if (end != mValue.npos) + { + msg = mValue.substr(start, end + 1 - start); + } + else + { + msg = mValue.substr(start); + } + } + // Convert any internal CR to LF + msg = utf8str_removeCRLF(msg); + return msg; +} + void LLXMLNode::setLineNumber(S32 line_number) { mLineNumber = line_number; @@ -3365,7 +3386,7 @@ bool LLXMLNode::fromXMLRPCValue(LLSD& target) if (childp->hasName("string")) { - target.assign(LLStringFn::xml_decode(childp->getTextContents())); + target.assign(LLStringFn::xml_decode(childp->getXMLRPCTextContents())); return true; } diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index 3769ec8293..09c7c4fdad 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -295,6 +295,7 @@ protected: bool removeChild(LLXMLNode* child); bool isFullyDefault(); + std::string getXMLRPCTextContents() const; bool parseXmlRpcArrayValue(LLSD& target); bool parseXmlRpcStructValue(LLSD& target); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7a29401bb6..049ec3ad34 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9289,7 +9289,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>1.5</real> + <real>1.0</real> </map> <key>RenderReflectionProbeDrawDistance</key> @@ -11771,6 +11771,28 @@ <key>Value</key> <integer>0</integer> </map> + <key>TextureDiscardBackgroundedTime</key> + <map> + <key>Comment</key> + <string>Specify how long to wait before discarding texture data after viewer is backgrounded. (zero or negative to disable)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>60.0</real> + </map> + <key>TextureDiscardMinimizedTime</key> + <map> + <key>Comment</key> + <string>Specify how long to wait before discarding texture data after viewer is minimized. (zero or negative to disable)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>1.0</real> + </map> <key>TextureFetchConcurrency</key> <map> <key>Comment</key> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 553d6c1d32..6390e43b7a 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 63 +version 64 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -81,7 +81,9 @@ RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderDownScaleMethod 1 1 RenderCASSharpness 1 1 - +RenderExposure 1 4 +RenderTonemapType 1 1 +RenderTonemapMix 1 1 // // Low Graphics Settings @@ -119,6 +121,9 @@ RenderHeroProbeDistance 1 4 RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Low Graphics Settings @@ -156,6 +161,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Graphics Settings (standard) @@ -193,6 +201,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium High Graphics Settings @@ -230,6 +241,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Graphics Settings (SSAO + sun shadows) @@ -267,6 +281,9 @@ RenderHeroProbeDistance 1 8 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Ultra Graphics Settings (deferred + SSAO + all shadows) @@ -304,6 +321,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Ultra graphics (REALLY PURTY!) @@ -341,6 +361,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index dc5d1ff6c4..9465acae6b 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,4 +1,4 @@ -version 29 +version 30 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -81,7 +81,9 @@ RenderHeroProbeUpdateRate 1 4 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderDownScaleMethod 1 1 RenderCASSharpness 1 1 - +RenderExposure 1 4 +RenderTonemapType 1 1 +RenderTonemapMix 1 1 // // Low Graphics Settings @@ -119,6 +121,9 @@ RenderHeroProbeDistance 1 4 RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Low Graphics Settings @@ -156,6 +161,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Graphics Settings (standard) @@ -193,6 +201,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium High Graphics Settings @@ -230,6 +241,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Graphics Settings (SSAO + sun shadows) @@ -267,6 +281,9 @@ RenderHeroProbeDistance 1 8 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Ultra Graphics Settings (deferred + SSAO + all shadows) @@ -304,6 +321,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Ultra graphics (REALLY PURTY!) @@ -341,6 +361,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index b1359f8b91..9ba922c3ce 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 61 +version 62 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -80,6 +80,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 1 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 1 // // Low Graphics Settings @@ -117,6 +120,9 @@ RenderHeroProbeDistance 1 4 RenderHeroProbeUpdateRate 1 6 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Low Graphics Settings @@ -154,6 +160,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium Graphics Settings (standard) @@ -191,6 +200,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 3 RenderHeroProbeConservativeUpdateMultiplier 1 16 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Medium High Graphics Settings @@ -228,6 +240,9 @@ RenderHeroProbeDistance 1 6 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Graphics Settings (SSAO + sun shadows) @@ -265,6 +280,9 @@ RenderHeroProbeDistance 1 8 RenderHeroProbeUpdateRate 1 2 RenderHeroProbeConservativeUpdateMultiplier 1 8 RenderCASSharpness 1 0 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // High Ultra Graphics Settings (SSAO + all shadows) @@ -302,6 +320,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Ultra graphics (REALLY PURTY!) @@ -339,6 +360,9 @@ RenderHeroProbeDistance 1 16 RenderHeroProbeUpdateRate 1 1 RenderHeroProbeConservativeUpdateMultiplier 1 4 RenderCASSharpness 1 0.4 +RenderExposure 1 1 +RenderTonemapType 1 1 +RenderTonemapMix 1 0.7 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 7cbbb89313..66dcd2f7ba 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -517,6 +517,7 @@ void LLPreviewGesture::addKeys() void LLPreviewGesture::addAnimations() { LLComboBox* combo = mAnimationCombo; + LLUUID old_value = combo->getCurrentID(); combo->removeall(); @@ -565,6 +566,8 @@ void LLPreviewGesture::addAnimations() combo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM); } + + combo->setCurrentByID(old_value); } @@ -1410,7 +1413,7 @@ void LLPreviewGesture::onCommitAnimation(LLUICtrl* ctrl, void* data) { // Assign the animation name LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step; - if (self->mAnimationCombo->getCurrentIndex() == 0) + if (self->mAnimationCombo->getCurrentIndex() <= 0) { anim_step->mAnimName.clear(); anim_step->mAnimAssetID.setNull(); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1b657d9ea1..800fc7ec0c 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -441,6 +441,16 @@ void LLPreviewTexture::onFileLoadedForSave(bool success, self->getWindow()->decBusyCount(); self->mLoadingFullImage = false; } + if (!success) + { + LL_WARNS("FileSaveAs") << "Failed to download file " << *item_uuid << " for saving." + << " Is missing: " << (src_vi->isMissingAsset() ? "true" : "false") + << " Discard: " << src_vi->getDiscardLevel() + << " Raw discard: " << discard_level + << " Size: " << src_vi->getWidth() << "x" << src_vi->getHeight() + << " Has GL texture: " << (src_vi->hasGLTexture() ? "true" : "false") + << " Has saved raw image: " << (src_vi->hasSavedRawImage() ? "true" : "false") << LL_ENDL; + } } if( self && final && success ) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index cb741e4af9..b0e07d8ea3 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -473,6 +473,35 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) // true = minimized, do not show/update the TP screen. HB update_tp_display(true); } + + // Run texture subsystem to discard memory while backgrounded + if (!gNonInteractive) + { + LL_PROFILE_ZONE_NAMED("Update Images"); + + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Class"); + LLViewerTexture::updateClass(); + } + + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Image Update Bump"); + gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first. + } + + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("List"); + F32 max_image_decode_time = 0.050f * gFrameIntervalSeconds.value(); // 50 ms/second decode time + max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f); // min 2ms/frame, max 5ms/frame) + gTextureList.updateImages(max_image_decode_time); + } + + { + LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("GLTF Materials Cleanup"); + // remove dead gltf materials + gGLTFMaterialList.flushMaterials(); + } + } return; } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 8c24b2438b..d92341eb96 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1750,6 +1750,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use { instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false); } + instance->postTeleportFinished(instance->mTeleportWithinRegion); + instance->mTeleportWithinRegion = false; } parcel->setParcelEnvironmentVersion(parcel_environment_version); LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; @@ -2709,6 +2711,8 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos // Local teleport. We already have the agent parcel data. // Emit the signal immediately. getInstance()->mTeleportFinishedSignal(new_pos, local); + + postTeleportFinished(true); } else { @@ -2717,12 +2721,14 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos // Let's wait for the update and then emit the signal. mTeleportInProgressPosition = new_pos; mTeleportInProgress = true; + mTeleportWithinRegion = local; } } void LLViewerParcelMgr::onTeleportFailed() { mTeleportFailedSignal(); + LLEventPumps::instance().obtain("LLTeleport").post(llsd::map("success", false)); } bool LLViewerParcelMgr::getTeleportInProgress() @@ -2730,3 +2736,17 @@ bool LLViewerParcelMgr::getTeleportInProgress() return mTeleportInProgress // case where parcel data arrives after teleport || gAgent.getTeleportState() > LLAgent::TELEPORT_NONE; // For LOCAL, no mTeleportInProgress } + +void LLViewerParcelMgr::postTeleportFinished(bool local) +{ + auto post = []() { LLEventPumps::instance().obtain("LLTeleport").post(llsd::map("success", true)); }; + if (local) + { + static LLCachedControl<F32> teleport_local_delay(gSavedSettings, "TeleportLocalDelay"); + LL::Timers::instance().scheduleAfter(post, teleport_local_delay + 0.5f); + } + else + { + post(); + } +} diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 974ea39359..4d54593c1e 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -295,6 +295,8 @@ public: void onTeleportFailed(); bool getTeleportInProgress(); + void postTeleportFinished(bool local); + static bool isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power); static bool isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power); @@ -344,8 +346,11 @@ private: std::vector<LLParcelObserver*> mObservers; + // Used to communicate between onTeleportFinished() and processParcelProperties() bool mTeleportInProgress; + bool mTeleportWithinRegion{ false }; LLVector3d mTeleportInProgressPosition; + teleport_finished_signal_t mTeleportFinishedSignal; teleport_failed_signal_t mTeleportFailedSignal; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0f9c65893d..82fefde0a7 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -43,6 +43,7 @@ #include "message.h" #include "lltimer.h" #include "v4coloru.h" +#include "llnotificationsutil.h" // viewer includes #include "llimagegl.h" @@ -505,8 +506,12 @@ void LLViewerTexture::updateClass() F32 budget = max_vram_budget == 0 ? (F32)gGLManager.mVRAM : (F32)max_vram_budget; - // try to leave half a GB for everyone else, but keep at least 768MB for ourselves - F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET); + // Try to leave at least half a GB for everyone else and for bias, + // but keep at least 768MB for ourselves + // Viewer can 'overshoot' target when scene changes, if viewer goes over budget it + // can negatively impact performance, so leave 20% of a breathing room for + // 'bias' calculation to kick in. + F32 target = llmax(llmin(budget - 512.f, budget * 0.8f), MIN_VRAM_BUDGET); sFreeVRAMMegabytes = target - used; F32 over_pct = (used - target) / target; @@ -522,7 +527,7 @@ void LLViewerTexture::updateClass() // slam to 1.5 bias the moment we hit low memory (discards off screen textures immediately) sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f); - if (is_sys_low) + if (is_sys_low || over_pct > 2.f) { // if we're low on system memory, emergency purge off screen textures to avoid a death spiral LL_WARNS() << "Low system memory detected, emergency downrezzing off screen textures" << LL_ENDL; for (auto& image : gTextureList) @@ -542,7 +547,6 @@ void LLViewerTexture::updateClass() { static LLCachedControl<F32> low_mem_min_discard_increment(gSavedSettings, "RenderLowMemMinDiscardIncrement", .1f); sDesiredDiscardBias += (F32) low_mem_min_discard_increment * (F32) gFrameIntervalSeconds; - sEvaluationTimer.reset(); } } else @@ -558,20 +562,49 @@ void LLViewerTexture::updateClass() } // set to max discard bias if the window has been backgrounded for a while + static F32 last_desired_discard_bias = 1.f; static bool was_backgrounded = false; static LLFrameTimer backgrounded_timer; + static LLCachedControl<F32> minimized_discard_time(gSavedSettings, "TextureDiscardMinimizedTime", 1.f); + static LLCachedControl<F32> backgrounded_discard_time(gSavedSettings, "TextureDiscardBackgroundedTime", 60.f); bool in_background = (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) || !gFocusMgr.getAppHasFocus(); - + bool is_minimized = gViewerWindow && gViewerWindow->getWindow()->getMinimized() && in_background; if (in_background) { - if (backgrounded_timer.getElapsedTimeF32() > 10.f) + F32 discard_time = is_minimized ? minimized_discard_time : backgrounded_discard_time; + if (discard_time > 0.f && backgrounded_timer.getElapsedTimeF32() > discard_time) { if (!was_backgrounded) { - LL_INFOS() << "Viewer is backgrounded, freeing up video memory." << LL_ENDL; + std::string notification_name; + std::string setting; + if (is_minimized) + { + notification_name = "TextureDiscardMinimized"; + setting = "TextureDiscardMinimizedTime"; + } + else + { + notification_name = "TextureDiscardBackgrounded"; + setting = "TextureDiscardBackgroundedTime"; + } + + LL_INFOS() << "Viewer was " << (is_minimized ? "minimized" : "backgrounded") << " for " << discard_time + << "s, freeing up video memory." << LL_ENDL; + + LLNotificationsUtil::add(notification_name, llsd::map("DELAY", discard_time), LLSD(), + [=](const LLSD& notification, const LLSD& response) + { + if (response["Cancel_okcancelignore"].asBoolean()) + { + LL_INFOS() << "User chose to disable texture discard on " << (is_minimized ? "minimizing." : "backgrounding.") << LL_ENDL; + gSavedSettings.setF32(setting, -1.f); + } + }); + last_desired_discard_bias = sDesiredDiscardBias; + was_backgrounded = true; } - was_backgrounded = true; sDesiredDiscardBias = 4.f; } } @@ -580,9 +613,9 @@ void LLViewerTexture::updateClass() backgrounded_timer.reset(); if (was_backgrounded) { // if the viewer was backgrounded - LL_INFOS() << "Viewer is no longer backgrounded, resuming normal texture usage." << LL_ENDL; + LL_INFOS() << "Viewer is no longer backgrounded or minimized, resuming normal texture usage." << LL_ENDL; was_backgrounded = false; - sDesiredDiscardBias = 1.f; + sDesiredDiscardBias = last_desired_discard_bias; } } @@ -1658,6 +1691,7 @@ void LLViewerFetchedTexture::processTextureStats() if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more { mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel); + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); mFullyLoaded = false; } //setDebugText("fully loaded"); @@ -1707,6 +1741,7 @@ void LLViewerFetchedTexture::processTextureStats() log((F32)mFullHeight / mKnownDrawHeight) / log_2); mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()); mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel); + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); } mKnownDrawSizeChanged = false; @@ -2431,6 +2466,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mIsRawImageValid) { // If we have an existing raw image, we have a baseline for the raw and auxiliary quality levels. + current_raw_discard = mRawDiscardLevel; best_raw_discard = llmin(best_raw_discard, mRawDiscardLevel); best_aux_discard = llmin(best_aux_discard, mRawDiscardLevel); // We always decode the aux when we decode the base raw current_aux_discard = llmin(current_aux_discard, best_aux_discard); @@ -2889,10 +2925,12 @@ void LLViewerLODTexture::processTextureStats() { // If the image has not been significantly visible in a while, we don't want it mDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)(MAX_DISCARD_LEVEL + 1)); + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); } else if (!mFullWidth || !mFullHeight) { mDesiredDiscardLevel = getMaxDiscardLevel(); + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); } else { @@ -2962,6 +3000,7 @@ void LLViewerLODTexture::processTextureStats() // stop requesting more mDesiredDiscardLevel = current_discard; } + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S32)mLoadedCallbackDesiredDiscardLevel); } if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index bc9732a9ef..489e5980d6 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1269,6 +1269,11 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) //update MIN_UPDATE_COUNT or 5% of other textures, whichever is greater update_count = llmax((U32) MIN_UPDATE_COUNT, (U32) mUUIDMap.size()/20); + if (LLViewerTexture::sDesiredDiscardBias > 1.f) + { + // we are over memory target, update more agresively + update_count = (S32)(update_count * LLViewerTexture::sDesiredDiscardBias); + } update_count = llmin(update_count, (U32) mUUIDMap.size()); { // copy entries out of UUID map to avoid iterator invalidation from deletion inside updateImageDecodeProiroty or updateFetch below diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 31f1bbcc21..39728b6818 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -786,7 +786,24 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) LLFace* face = mDrawable->getFace(i); if (!face) continue; const LLTextureEntry *te = face->getTextureEntry(); - LLViewerTexture *imagep = face->getTexture(); + LLViewerTexture *imagep = nullptr; + U32 ch_min; + U32 ch_max; + if (!te->getGLTFRenderMaterial()) + { + ch_min = LLRender::DIFFUSE_MAP; + ch_max = LLRender::SPECULAR_MAP; + } + else + { + ch_min = LLRender::BASECOLOR_MAP; + ch_max = LLRender::EMISSIVE_MAP; + } + for (U32 ch = ch_min; (!imagep && ch <= ch_max); ++ch) + { + // Get _a_ non-null texture if possible (usually diffuse/basecolor, but could be something else) + imagep = face->getTexture(ch); + } if (!imagep || !te || face->mExtents[0].equals3(face->mExtents[1])) { diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 0f956d8350..5b24d46bb0 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -313,6 +313,8 @@ bool LLXMLRPCTransaction::Impl::process() if (mHasResponse && !mResponseParsed) { LLXMLNodePtr root; + bool strip_escaped_strings = LLXMLNode::sStripEscapedStrings; + LLXMLNode::sStripEscapedStrings = false; if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(), root, nullptr)) { @@ -329,6 +331,7 @@ bool LLXMLRPCTransaction::Impl::process() LL_WARNS() << "XMLRPC response parsing failed; request URI: " << mURI << LL_ENDL; } + LLXMLNode::sStripEscapedStrings = strip_escaped_strings; mResponseParsed = true; } diff --git a/indra/newview/scripts/lua/frame_profile.lua b/indra/newview/scripts/lua/frame_profile.lua index 3c6353ff68..4d0874f55e 100644 --- a/indra/newview/scripts/lua/frame_profile.lua +++ b/indra/newview/scripts/lua/frame_profile.lua @@ -4,11 +4,13 @@ LLAgent = require 'LLAgent' startup = require 'startup' Timer = (require 'timers').Timer UI = require 'UI' +teleport_util = require('teleport_util') startup.wait('STATE_STARTED') -- teleport to http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27 print(LLAgent.teleport{regionname='Bug Island', x=220, y=224, z=27}) +--teleport_util.wait() Timer(10, 'wait') LLAgent.setCamera{camera_pos={220, 224, 26}, camera_locked=true, focus_pos ={228, 232, 26}, focus_locked=true} diff --git a/indra/newview/scripts/lua/require/teleport_util.lua b/indra/newview/scripts/lua/require/teleport_util.lua new file mode 100644 index 0000000000..8a46768e54 --- /dev/null +++ b/indra/newview/scripts/lua/require/teleport_util.lua @@ -0,0 +1,28 @@ +local leap = require 'leap' + +local teleport_util = {} + +local teleport_pump = 'LLTeleport' +local waitfor = leap.WaitFor(0, teleport_pump) +function waitfor:filter(pump, data) + if pump == self.name then + return data + end +end + +function waitfor:process(data) + teleport_util._success = data.success + leap.WaitFor.process(self, data) +end + +leap.request(leap.cmdpump(), + {op='listen', source=teleport_pump, listener='teleport.lua', tweak=true}) + +function teleport_util.wait() + while teleport_util._success == nil do + local item = waitfor:wait() + end + return teleport_util._success +end + +return teleport_util diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 73ea0f548e..e81ff7f343 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -821,7 +821,7 @@ layout="topleft" left="420" min_val="0.5" - max_val="1.5" + max_val="4.0" name="RenderExposure" show_text="true" top_delta="24" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4d74261a9a..cbc0f7ceae 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12603,4 +12603,34 @@ are wearing now. yestext="OK"/> </notification> + <notification + icon="notify.tga" + name="TextureDiscardBackgrounded" + type="notify"> + <unique> + <context>DELAY</context> + </unique> + To improve system performance, [SECOND_LIFE] has reduced texture memory usage after being in the background for [DELAY] seconds. It may take some time for texture image quality to return to normal. + <usetemplate + ignoretext="Ask me about background texture memory usage and recovery" + name="okcancelignore" + yestext="OK" + notext="Disable"/> + </notification> + + <notification + icon="notify.tga" + name="TextureDiscardMinimized" + type="notify"> + <unique> + <context>DELAY</context> + </unique> + To improve system performance, [SECOND_LIFE] has reduced texture memory usage after being minimized for [DELAY] seconds. It may take some time for texture image quality to return to normal. + <usetemplate + ignoretext="Ask me about minimized texture memory usage and recovery" + name="okcancelignore" + yestext="OK" + notext="Disable"/> + </notification> + </notifications> |