diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-12 12:10:44 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-12 12:10:44 -0500 |
commit | 5188a26a8521251dda07ac0140bb129f28417e49 (patch) | |
tree | 3a2239ad294f3cd33926416264e0bcbe520e8b9c /indra/newview | |
parent | 75110629de7786d667ea7c90b025f97c22650316 (diff) | |
parent | 819088563e13f1d75e048311fbaf0df4a79b7e19 (diff) |
SL-16220: Merge branch 'origin/DRTVWR-546' into glthread
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewerstats.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewerstats.h | 4 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 3 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 40 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_stats.xml | 19 |
11 files changed, 108 insertions, 29 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 02b4dd57f1..93e5c2e341 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -579,7 +579,7 @@ static void settings_modify() LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred"); LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 5f9e623b4c..2f3c52ecd2 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -137,6 +137,14 @@ void LLDrawPoolWater::endPostDeferredPass(S32 pass) void LLDrawPoolWater::renderDeferred(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_RENDER_WATER); + + if (!LLPipeline::sRenderTransparentWater) + { + // Will render opaque water without use of ALM + render(pass); + return; + } + deferred_render = TRUE; shade(); deferred_render = FALSE; @@ -340,6 +348,11 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() LL_PROFILE_ZONE_SCOPED; LLVOSky *voskyp = gSky.mVOSkyp; + if (voskyp == NULL) + { + return; + } + LLGLSLShader* shader = NULL; if (LLGLSLShader::sNoFixedFunction) { diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6bf2136f60..92e64d0b95 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1198,11 +1198,9 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); - BOOL transparent_water = LLFeatureManager::getInstance()->isFeatureAvailable("RenderTransparentWater") && gSavedSettings.getBOOL("RenderTransparentWater"); BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && bumpshiny && - transparent_water && shaders && gGLManager.mHasFramebufferObject && gSavedSettings.getBOOL("RenderAvatarVP") && @@ -1226,9 +1224,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() ctrl_reflections->setEnabled(reflections); reflections_text->setEnabled(reflections); - // Transparent Water - LLCheckBoxCtrl* transparent_water_ctrl = getChild<LLCheckBoxCtrl>("TransparentWater"); - // Bump & Shiny LLCheckBoxCtrl* bumpshiny_ctrl = getChild<LLCheckBoxCtrl>("BumpShiny"); bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); @@ -1279,7 +1274,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && - ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && gGLManager.mHasFramebufferObject && gSavedSettings.getBOOL("RenderAvatarVP") && (ctrl_wind_light->get()) ? TRUE : FALSE; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 3e7459ee8a..e5ebbcb9ab 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -187,7 +187,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) bool handleRenderTransparentWaterChanged(const LLSD& newvalue) { - LLRenderTarget::sUseFBO = newvalue.asBoolean(); if (gPipeline.isInit()) { gPipeline.updateRenderTransparentWater(); @@ -243,7 +242,9 @@ static bool handleAnisotropicChanged(const LLSD& newvalue) static bool handleVSyncChanged(const LLSD& newvalue) { +#if LL_WINDOWS gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean()); +#endif return true; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7dcf29eb75..1b6d8210c3 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -424,7 +424,7 @@ void LLViewerShaderMgr::setShaders() initAttribsAndUniforms(); gPipeline.releaseGLBuffers(); - LLPipeline::sWaterReflections = gGLManager.mHasCubeMap; + LLPipeline::sWaterReflections = gGLManager.mHasCubeMap && LLPipeline::sRenderTransparentWater; LLPipeline::sRenderGlow = gSavedSettings.getBOOL("RenderGlow"); LLPipeline::updateRenderDeferred(); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 314c1a1f1e..1fda2fb20e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -183,8 +183,9 @@ SimMeasurement<F64Kilobytes > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_S SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - SIM_PING("simpingstat"); + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + FRAMETIME("frametime", "Measured frame time"), + SIM_PING("simpingstat"); LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); @@ -261,8 +262,11 @@ void LLViewerStats::updateFrameStats(const F64Seconds time_diff) // new "stutter" meter add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); + sample(LLStatViewer::FRAMETIME, time_diff); + // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff)); + F64Seconds jit = (F64Seconds) std::fabs((mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, jit); F32Seconds average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff)); diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 04870e0c26..ac8eccc0ca 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -218,8 +218,8 @@ extern SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM; extern LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER, - FRAMETIME_SLEW, - SIM_PING; + FRAMETIME_SLEW, + SIM_PING; extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4a179146f8..04356e6507 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -126,6 +126,9 @@ const F32 MIN_HOVER_Z = -2.0; const F32 MIN_ATTACHMENT_COMPLEXITY = 0.f; const F32 DEFAULT_MAX_ATTACHMENT_COMPLEXITY = 1.0e6f; +const F32 FIRST_APPEARANCE_CLOUD_MIN_DELAY = 3.f; // seconds +const F32 FIRST_APPEARANCE_CLOUD_MAX_DELAY = 45.f; + using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- @@ -667,6 +670,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisuallyMuteSetting(AV_RENDER_NORMALLY), mMutedAVColor(LLColor4::white /* used for "uninitialize" */), mFirstFullyVisible(TRUE), + mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY), mFullyLoaded(FALSE), mPreviousFullyLoaded(FALSE), mFullyLoadedInitialized(FALSE), @@ -741,7 +745,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCurrentGesticulationLevel = 0; - + mFirstSeenTimer.reset(); mRuthTimer.reset(); mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); @@ -8126,16 +8130,35 @@ void LLVOAvatar::updateRuthTimer(bool loading) BOOL LLVOAvatar::processFullyLoadedChange(bool loading) { // We wait a little bit before giving the 'all clear', to let things to - // settle down (models to snap into place, textures to get first packets) + // settle down (models to snap into place, textures to get first packets). + // And if viewer isn't aware of some parts yet, this gives them a chance + // to arrive. const F32 LOADED_DELAY = 1.f; - const F32 FIRST_USE_DELAY = 3.f; - if (loading) - mFullyLoadedTimer.reset(); + if (loading) + { + mFullyLoadedTimer.reset(); + } if (mFirstFullyVisible) { - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY); + if (!isSelf() && loading) + { + // Note that textures can causes 60s delay on thier own + // so this delay might end up on top of textures' delay + mFirstUseDelaySeconds = llclamp( + mFirstSeenTimer.getElapsedTimeF32(), + FIRST_APPEARANCE_CLOUD_MIN_DELAY, + FIRST_APPEARANCE_CLOUD_MAX_DELAY); + + if (shouldImpostor()) + { + // Impostors are less of a priority, + // let them stay cloud longer + mFirstUseDelaySeconds *= 1.25; + } + } + mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds); } else { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7042406091..aeac23ad92 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -376,6 +376,9 @@ protected: private: BOOL mFirstFullyVisible; + F32 mFirstUseDelaySeconds; + LLFrameTimer mFirstSeenTimer; + BOOL mFullyLoaded; BOOL mPreviousFullyLoaded; BOOL mFullyLoadedInitialized; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 71a438302a..de95eb1a87 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1047,7 +1047,6 @@ void LLPipeline::updateRenderDeferred() RenderDeferred && LLRenderTarget::sUseFBO && LLPipeline::sRenderBump && - LLPipeline::sRenderTransparentWater && RenderAvatarVP && WindLightUseAtmosShaders && (bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"); @@ -9203,7 +9202,13 @@ inline float sgn(float a) void LLPipeline::generateWaterReflection(LLCamera& camera_in) { LL_PROFILE_ZONE_SCOPED; - if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) + + if (!assertInitialized()) + { + return; + } + + if (LLPipeline::sWaterReflections && LLDrawPoolWater::sNeedsReflectionUpdate) { bool skip_avatar_update = false; if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) @@ -9423,19 +9428,13 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) //clip out geometry on the same side of water as the camera w/ enough margin to not include the water geo itself, // but not so much as to clip out parts of avatars that should be seen under the water in the distortion map - LLPlane plane(-pnorm, water_dist); + LLPlane plane(-pnorm, camera_is_underwater ? -water_height : water_dist); LLGLUserClipPlane clip_plane(plane, saved_modelview, saved_projection); gGL.setColorMask(true, true); mWaterDis.clear(); gGL.setColorMask(true, false); - // ignore clip plane if we're underwater and viewing distortion map of objects above waterline - if (camera_is_underwater) - { - clip_plane.disable(); - } - if (reflection_detail >= WATER_REFLECT_NONE_WATER_TRANSPARENT) { updateCull(camera, mRefractedObjects, water_clip, &plane); @@ -9488,6 +9487,29 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; } + else + { + // Initial sky pass is still needed even if water reflection is not rendering + bool camera_is_underwater = LLViewerCamera::getInstance()->cameraUnderWater(); + if (!camera_is_underwater) + { + gPipeline.pushRenderTypeMask(); + { + gPipeline.andRenderTypeMask( + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::END_RENDER_TYPES); + + LLCamera camera = camera_in; + camera.setFar(camera_in.getFar() * 0.75f); + + updateCull(camera, mSky); + stateSort(camera, mSky); + renderGeom(camera, TRUE); + } + gPipeline.popRenderTypeMask(); + } + } } glh::matrix4f look(const LLVector3 pos, const LLVector3 dir, const LLVector3 up) diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index e4f735740b..6f84930c75 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -35,6 +35,25 @@ decimal_digits="1" show_bar="true" show_history="true"/> + <stat_bar name="frame_mean" + label="frame (mean)" + unit_label="ms" + stat="frametime" + decimal_digits="1" + show_bar="false" + show_history="false"/> + <stat_bar name="frame_median" + label="frame (median)" + unit_label="ms" + stat="frametime" + show_median="true" + decimal_digits="1" + show_bar="false" + show_history="false"/> + <stat_bar name="framet_jitter" + label="jitter" + decimal_digits="1" + stat="frametimejitter"/> <stat_bar name="bandwidth" label="UDP Data Received" stat="activemessagedatareceived" |