Make octree walk stop thrashing the caches with tex work.

Add many more fast timer blocks to differentiate where time goes in UI and Shadow rendering.
meow-7.2.2
Graham Linden 2019-03-06 10:09:59 -08:00
parent 3396b728d2
commit 3f48633b7d
5 changed files with 39 additions and 20 deletions

View File

@ -1314,6 +1314,8 @@ static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield");
static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache");
static LLTrace::BlockTimerStatHandle FTM_DECODE("Image Decode");
static LLTrace::BlockTimerStatHandle FTM_FETCH("Image Fetch");
static LLTrace::BlockTimerStatHandle FTM_VFS("VFS Thread");
static LLTrace::BlockTimerStatHandle FTM_LFS("LFS Thread");
static LLTrace::BlockTimerStatHandle FTM_PAUSE_THREADS("Pause Threads");
@ -1628,7 +1630,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time)
work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
}
{
LL_RECORD_BLOCK_TIME(FTM_DECODE);
LL_RECORD_BLOCK_TIME(FTM_FETCH);
work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
}
return work_pending;

View File

@ -1036,8 +1036,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI");
if (!for_snapshot)
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
{
render_ui();
swap();
}
@ -1265,6 +1264,8 @@ bool setup_hud_matrices(const LLRect& screen_region)
void render_ui(F32 zoom_factor, int subfield)
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
LLGLState::checkStates();
glh::matrix4f saved_view = get_current_modelview();
@ -1278,6 +1279,7 @@ void render_ui(F32 zoom_factor, int subfield)
if(LLSceneMonitor::getInstance()->needsUpdate())
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_SCENE_MON);
gGL.pushMatrix();
gViewerWindow->setup2DRender();
LLSceneMonitor::getInstance()->compare();
@ -1286,6 +1288,7 @@ void render_ui(F32 zoom_factor, int subfield)
}
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_HUD);
render_hud_elements();
render_hud_attachments();
}
@ -1300,10 +1303,9 @@ void render_ui(F32 zoom_factor, int subfield)
gGL.color4f(1,1,1,1);
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
if (!gDisconnected)
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_3D);
render_ui_3d();
LLGLState::checkStates();
}
@ -1312,12 +1314,14 @@ void render_ui(F32 zoom_factor, int subfield)
render_disconnected_background();
}
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_2D);
render_ui_2d();
LLGLState::checkStates();
}
gGL.flush();
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_DEBUG_TEXT);
gViewerWindow->setup2DRender();
gViewerWindow->updateDebugText();
gViewerWindow->drawDebugText();

View File

@ -1110,16 +1110,13 @@ void LLOcclusionCullingGroup::checkOcclusion()
static LLCachedControl<bool> wait_for_query(gSavedSettings, "RenderSynchronousOcclusion", true);
if (wait_for_query && mOcclusionIssued[LLViewerCamera::sCurCameraID] < gFrameCount)
U32 target_read_frame = (gFrameCount > 2) ? (gFrameCount - 2) : 0;
if (wait_for_query && (mOcclusionIssued[LLViewerCamera::sCurCameraID] < target_read_frame))
{ //query was issued last frame, wait until it's available
S32 max_loop = 1024;
S32 max_loop = 64;
LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_WAIT);
while (!available && max_loop-- > 0)
{
//do some usefu work while we wait
F32 max_time = llmin(gFrameIntervalSeconds.value()*10.f, 1.f);
LLAppViewer::instance()->updateTextureThreads(max_time);
glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
}
}

View File

@ -254,6 +254,11 @@ LLTrace::BlockTimerStatHandle FTM_PIPELINE("Pipeline");
LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY("Client Copy");
LLTrace::BlockTimerStatHandle FTM_RENDER_DEFERRED("Deferred Shading");
LLTrace::BlockTimerStatHandle FTM_RENDER_UI_HUD("HUD");
LLTrace::BlockTimerStatHandle FTM_RENDER_UI_3D("3D");
LLTrace::BlockTimerStatHandle FTM_RENDER_UI_2D("2D");
LLTrace::BlockTimerStatHandle FTM_RENDER_UI_DEBUG_TEXT("Debug Text");
LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON("Scene Mon");
static LLTrace::BlockTimerStatHandle FTM_STATESORT_DRAWABLE("Sort Drawables");
static LLTrace::BlockTimerStatHandle FTM_STATESORT_POSTSORT("Post Sort");
@ -4068,7 +4073,6 @@ void LLPipeline::postSort(LLCamera& camera)
void render_hud_elements()
{
LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
gPipeline.disableLights();
LLGLDisable fog(GL_FOG);
@ -9434,7 +9438,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
set_current_modelview(current);
}
LLPipeline::sUseOcclusion = occlusion;
//LLPipeline::sUseOcclusion = occlusion;
camera.setOrigin(camera_in.getOrigin());
//render distortion map
@ -9499,7 +9503,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
renderGeom(camera);
if (LLGLSLShader::sNoFixedFunction)
/*if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.bind();
}
@ -9509,7 +9513,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.unbind();
}
}*/
mWaterDis.flush();
}
@ -10077,6 +10081,10 @@ LLRenderTarget* LLPipeline::getShadowTarget(U32 i)
}
static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW("Gen Sun Shadow");
static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW_SETUP("Sun Shadow Setup");
static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW_RENDER_DIRECTIONAL("Render Dir");
static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW_SPOT_SETUP("Spot Shadow Setup");
static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW_SPOT_RENDER("Spot Shadow Render");
void LLPipeline::generateSunShadow(LLCamera& camera)
{
@ -10093,11 +10101,6 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
skip_avatar_update = true;
}
if (!skip_avatar_update)
{
gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
}
F64 last_modelview[16];
F64 last_projection[16];
for (U32 i = 0; i < 16; i++)
@ -10320,6 +10323,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
{
for (S32 j = 0; j < 4; j++)
{
LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW_SETUP);
if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA))
{
mShadowFrustPoints[j].clear();
@ -10688,6 +10693,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
U32 target_width = shadow_target->getWidth();
{
LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW_RENDER_DIRECTIONAL);
static LLCullResult result[4];
renderShadow(view[j], proj[j], shadow_cam, result[j], TRUE, TRUE, target_width);
}
@ -10709,6 +10716,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
if (gen_shadow)
{
LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW_SPOT_SETUP);
LLTrace::CountStatHandle<>* velocity_stat = LLViewerCamera::getVelocityStat();
F32 fade_amt = gFrameIntervalSeconds.value()
* llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0);
@ -10831,6 +10840,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
if (shadow_target)
{
LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW_SPOT_RENDER);
shadow_target->bindTarget();
shadow_target->getViewport(gGLViewport);
shadow_target->clear();

View File

@ -84,6 +84,11 @@ extern LLTrace::BlockTimerStatHandle FTM_STATESORT;
extern LLTrace::BlockTimerStatHandle FTM_PIPELINE;
extern LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_HUD;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_3D;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_2D;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_DEBUG_TEXT;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON;
class LLPipeline
{