summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 15:02:02 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 15:02:02 -0400
commit58d5e223b8a15b4825b96923b5891b251c6ccc98 (patch)
tree8c1747e6c8067fcb5ad363fb7a202e39553e1ac2 /indra/newview/llviewerdisplay.cpp
parenta5c9d89b28d74c1996a0c950a0c8b1484b43d243 (diff)
parentb8bac66a0f8c392a221ad2c64611e2a55de82339 (diff)
merge
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 4571d08050..d58ee05fb6 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -79,6 +79,7 @@
#include "llpostprocess.h"
extern LLPointer<LLViewerTexture> gStartTexture;
+extern bool gShiftFrame;
LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
@@ -162,8 +163,11 @@ void display_startup()
glClear(GL_DEPTH_BUFFER_BIT);
}
+static LLFastTimer::DeclareTimer FTM_UPDATE_CAMERA("Update Camera");
+
void display_update_camera()
{
+ LLFastTimer t(FTM_UPDATE_CAMERA);
LLMemType mt_uc(LLMemType::MTYPE_DISPLAY_UPDATE_CAMERA);
// TODO: cut draw distance down if customizing avatar?
// TODO: cut draw distance on per-parcel basis?
@@ -217,6 +221,11 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_CLASS("Class");
static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_BUMP("Bump");
static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_LIST("List");
static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_DELETE("Delete");
+static LLFastTimer::DeclareTimer FTM_RESIZE_WINDOW("Resize Window");
+static LLFastTimer::DeclareTimer FTM_HUD_UPDATE("HUD Update");
+static LLFastTimer::DeclareTimer FTM_DISPLAY_UPDATE_GEOM("Update Geom");
+static LLFastTimer::DeclareTimer FTM_TEXTURE_UNBIND("Texture Unbind");
+static LLFastTimer::DeclareTimer FTM_TELEPORT_DISPLAY("Teleport Display");
// Paint the display!
void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
@@ -226,6 +235,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gWindowResized)
{ //skip render on frames where window has been resized
+ LLFastTimer t(FTM_RESIZE_WINDOW);
gGL.flush();
glClear(GL_COLOR_BUFFER_BIT);
gViewerWindow->getWindow()->swapBuffers();
@@ -362,6 +372,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gTeleportDisplay)
{
+ LLFastTimer t(FTM_TELEPORT_DISPLAY);
LLAppViewer::instance()->pingMainloopTimeout("Display:Teleport");
const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
@@ -425,6 +436,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAgent::sTeleportProgressMessages["arriving"]);
gTextureList.mForceResetTextureStats = TRUE;
gAgentCamera.resetView(TRUE, TRUE);
+
break;
case LLAgent::TELEPORT_ARRIVING:
@@ -590,6 +602,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// *TODO: merge these two methods
{
+ LLFastTimer t(FTM_HUD_UPDATE);
LLMemType mt_uh(LLMemType::MTYPE_DISPLAY_UPDATE_HUD);
LLHUDManager::getInstance()->updateEffects();
LLHUDObject::updateAll();
@@ -597,6 +610,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
{
+ LLFastTimer t(FTM_DISPLAY_UPDATE_GEOM);
LLMemType mt_ug(LLMemType::MTYPE_DISPLAY_UPDATE_GEOM);
const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time
gPipeline.createObjects(max_geom_update_time);
@@ -606,6 +620,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
gPipeline.updateGL();
+
stop_glerror();
S32 water_clip = 0;
@@ -765,7 +780,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLImageGL::deleteDeadTextures();
stop_glerror();
}*/
- }
+ }
LLGLState::checkStates();
LLGLState::checkClientArrays();
@@ -937,14 +952,18 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
stop_glerror();
}
- for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
- { //dummy cleanup of any currently bound textures
- if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
- {
- gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
- gGL.getTexUnit(i)->disable();
+ {
+ LLFastTimer t(FTM_TEXTURE_UNBIND);
+ for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
+ { //dummy cleanup of any currently bound textures
+ if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
+ {
+ gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
+ gGL.getTexUnit(i)->disable();
+ }
}
}
+
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush");
if (to_texture)
@@ -1010,6 +1029,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
display_stats();
LLAppViewer::instance()->pingMainloopTimeout("Display:Done");
+
+ gShiftFrame = false;
}
void render_hud_attachments()