summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorMichael Pohoreski <ptolemy@lindenlab.com>2021-08-27 07:00:13 +0000
committerMichael Pohoreski <ptolemy@lindenlab.com>2021-08-27 07:00:13 +0000
commit134dc986361256d71884257cb870a1f1ac6a848c (patch)
tree5dc0b5719916977b4a35005aed24bd4aedd19d93 /indra/newview/llviewerdisplay.cpp
parent7637f9845b351a7cb3e41d97db7d3715e119e2df (diff)
parentcdf2bdafd394a97b917cc0a71b2bc8531cce40c7 (diff)
Merged in SL-15709-Tracy (pull request #634)
SL-15709: Add Tracy support to viewer
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp81
1 files changed, 45 insertions, 36 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 109dc93261..a590237440 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1259,7 +1259,7 @@ bool setup_hud_matrices(const LLRect& screen_region)
void render_ui(F32 zoom_factor, int subfield)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
LLGLState::checkStates();
@@ -1274,7 +1274,7 @@ void render_ui(F32 zoom_factor, int subfield)
if(LLSceneMonitor::getInstance()->needsUpdate())
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_SCENE_MON);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_SCENE_MON);
gGL.pushMatrix();
gViewerWindow->setup2DRender();
LLSceneMonitor::getInstance()->compare();
@@ -1282,55 +1282,64 @@ void render_ui(F32 zoom_factor, int subfield)
gGL.popMatrix();
}
- // Finalize scene
- gPipeline.renderFinalize();
+ // Finalize scene
+ gPipeline.renderFinalize();
- LL_RECORD_BLOCK_TIME(FTM_RENDER_HUD);
- render_hud_elements();
- render_hud_attachments();
-
- LLGLSDefault gls_default;
- LLGLSUIDefault gls_ui;
{
- gPipeline.disableLights();
- }
+ // SL-15709
+ // NOTE: Tracy only allows one ZoneScoped per function.
+ // Solutions are:
+ // 1. Use a new scope
+ // 2. Use named zones
+ // 3. Use transient zones
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_HUD);
+ render_hud_elements();
+ render_hud_attachments();
+
+ LLGLSDefault gls_default;
+ LLGLSUIDefault gls_ui;
+ {
+ gPipeline.disableLights();
+ }
- {
- gGL.color4f(1,1,1,1);
- if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- if (!gDisconnected)
+ gGL.color4f(1,1,1,1);
+ if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_3D);
- render_ui_3d();
+ if (!gDisconnected)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_3D);
+ render_ui_3d();
+ LLGLState::checkStates();
+ }
+ else
+ {
+ render_disconnected_background();
+ }
+
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_2D);
+ render_ui_2d();
LLGLState::checkStates();
}
- else
+ gGL.flush();
+
{
- render_disconnected_background();
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_DEBUG_TEXT);
+ gViewerWindow->setup2DRender();
+ gViewerWindow->updateDebugText();
+ gViewerWindow->drawDebugText();
}
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_2D);
- render_ui_2d();
- LLGLState::checkStates();
+ LLVertexBuffer::unbind();
}
- gGL.flush();
+ if (!gSnapshot)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_UI_DEBUG_TEXT);
- gViewerWindow->setup2DRender();
- gViewerWindow->updateDebugText();
- gViewerWindow->drawDebugText();
+ set_current_modelview(saved_view);
+ gGL.popMatrix();
}
- LLVertexBuffer::unbind();
- }
-
- if (!gSnapshot)
- {
- set_current_modelview(saved_view);
- gGL.popMatrix();
- }
+ } // Tracy integration
}
static LLTrace::BlockTimerStatHandle FTM_SWAP("Swap");