Skip to content

Commit 9a6129b

Browse files
committed
viewer#2780 Speed up terrain loading on teleport
Terrain was arriving and processing too late resulting in issues like "Lower terrain material incorrectly shown momentarily"
1 parent b29770e commit 9a6129b

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

indra/newview/llappviewer.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,6 +4968,20 @@ void LLAppViewer::idle()
49684968

49694969
if (gTeleportDisplay)
49704970
{
4971+
if (gAgent.getTeleportState() == LLAgent::TELEPORT_ARRIVING)
4972+
{
4973+
// Teleported, but waiting for things to load, start processing surface data
4974+
{
4975+
LL_RECORD_BLOCK_TIME(FTM_NETWORK);
4976+
gVLManager.unpackData();
4977+
}
4978+
{
4979+
LL_RECORD_BLOCK_TIME(FTM_REGION_UPDATE);
4980+
const F32 max_region_update_time = .001f; // 1ms
4981+
LLWorld::getInstance()->updateRegions(max_region_update_time);
4982+
}
4983+
}
4984+
49714985
return;
49724986
}
49734987

indra/newview/llviewermessage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,8 @@ void send_agent_update(bool force_send, bool send_reliable)
31973197
LL_PROFILE_ZONE_SCOPED;
31983198
llassert(!gCubeSnapshot);
31993199

3200-
if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
3200+
if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE
3201+
&& gAgent.getTeleportState() != LLAgent::TELEPORT_ARRIVING)
32013202
{
32023203
// We don't care if they want to send an agent update, they're not allowed
32033204
// until the target simulator is ready to receive them

indra/newview/llviewertexturelist.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "llviewertexturelist.h"
3232

33+
#include "llagent.h"
3334
#include "llgl.h" // fot gathering stats from GL
3435
#include "llimagegl.h"
3536
#include "llimagebmp.h"
@@ -844,10 +845,19 @@ void LLViewerTextureList::updateImages(F32 max_time)
844845
clearFetchingRequests();
845846
gPipeline.clearRebuildGroups();
846847
cleared = true;
848+
return;
847849
}
848-
return;
850+
// ARRIVING is a delay to let things decode, cache and process,
851+
// so process textures like normal despite gTeleportDisplay
852+
if (gAgent.getTeleportState() != LLAgent::TELEPORT_ARRIVING)
853+
{
854+
return;
855+
}
856+
}
857+
else
858+
{
859+
cleared = false;
849860
}
850-
cleared = false;
851861

852862
LLAppViewer::getTextureFetch()->setTextureBandwidth((F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED).value());
853863

0 commit comments

Comments
 (0)