From fb59eb296927ca8dae5058bf71383bf2cfcc97fd Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 17 Jan 2023 16:37:43 -0500
Subject: [PATCH] Clean out parts of the dead profiler

---
 indra/newview/lldrawpooltree.cpp     | 14 ++++----
 indra/newview/llviewermedia.cpp      | 16 ---------
 indra/newview/llviewerobjectlist.cpp |  4 +--
 indra/newview/llviewerpartsim.cpp    |  5 +--
 indra/newview/llviewerstats.cpp      |  4 +--
 indra/newview/pipeline.cpp           | 50 ----------------------------
 indra/newview/pipeline.h             | 25 --------------
 7 files changed, 11 insertions(+), 107 deletions(-)

diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 60a9b5fdc7d..93f20522ced 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -57,7 +57,7 @@ void LLDrawPoolTree::prerender()
 
 void LLDrawPoolTree::beginRenderPass(S32 pass)
 {
-	LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
+	LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 		
 	if (LLPipeline::sUnderWaterRender)
 	{
@@ -83,7 +83,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
 
 void LLDrawPoolTree::render(S32 pass)
 {
-    LL_PROFILE_ZONE_SCOPED;
+    LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 
 	if (mDrawFace.empty())
 	{
@@ -133,7 +133,7 @@ void LLDrawPoolTree::render(S32 pass)
 
 void LLDrawPoolTree::endRenderPass(S32 pass)
 {
-	LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
+	LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 		
 	if (gPipeline.canUseWindLightShadersOnObjects())
 	{
@@ -151,7 +151,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
 //============================================
 void LLDrawPoolTree::beginDeferredPass(S32 pass)
 {
-	LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
+	LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 		
 	shader = &gDeferredTreeProgram;
 	shader->bind();
@@ -160,13 +160,13 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass)
 
 void LLDrawPoolTree::renderDeferred(S32 pass)
 {
-    LL_PROFILE_ZONE_SCOPED;
+    LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 	render(pass);
 }
 
 void LLDrawPoolTree::endDeferredPass(S32 pass)
 {
-	LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
+	LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 		
 	shader->unbind();
 }
@@ -176,7 +176,7 @@ void LLDrawPoolTree::endDeferredPass(S32 pass)
 //============================================
 void LLDrawPoolTree::beginShadowPass(S32 pass)
 {
-    LL_PROFILE_ZONE_SCOPED;
+    LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
 	
 	glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"),
 					gSavedSettings.getF32("RenderDeferredTreeShadowBias"));
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 716fd15a30d..cfd85628d50 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -604,15 +604,6 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi
 	}
 }
 
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_UPDATE("Update Media");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_SPARE_IDLE("Spare Idle");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_UPDATE_INTEREST("Update/Interest");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_UPDATE_VOLUME("Update/Volume");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_SORT("Media Sort");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_SORT2("Media Sort 2");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_MISC("Misc");
-
-
 //////////////////////////////////////////////////////////////////////////////////////////
 void LLViewerMedia::onIdle(void *dummy_arg)
 {
@@ -2790,11 +2781,6 @@ bool LLViewerMediaImpl::canNavigateBack()
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_DO_UPDATE("Do Update");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_GET_DATA("Get Data");
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_SET_SUBIMAGE("Set Subimage");
-
-
 void LLViewerMediaImpl::update()
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA; //LL_RECORD_BLOCK_TIME(FTM_MEDIA_DO_UPDATE);
@@ -3663,8 +3649,6 @@ BOOL LLViewerMediaImpl::isUpdated()
 	return mIsUpdated ;
 }
 
-static LLTrace::BlockTimerStatHandle FTM_MEDIA_CALCULATE_INTEREST("Calculate Interest");
-
 void LLViewerMediaImpl::calculateInterest()
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA; //LL_RECORD_BLOCK_TIME(FTM_MEDIA_CALCULATE_INTEREST);
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index ebcfa5c3e81..02549235fb0 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -304,8 +304,6 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	}
 }
 
-static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Objects");
-
 LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* entry, LLViewerRegion* regionp)
 {
 	LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
@@ -408,7 +406,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 											 const EObjectUpdateType update_type,
 											 bool compressed)
 {
-	LL_RECORD_BLOCK_TIME(FTM_PROCESS_OBJECTS);	
+	LL_PROFILE_ZONE_SCOPED;
 	
 	LLViewerObject *objectp;
 	S32			num_objects;
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index c3ade861b34..9b4ce46d936 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -654,10 +654,9 @@ void LLViewerPartSim::shift(const LLVector3 &offset)
 	}
 }
 
-static LLTrace::BlockTimerStatHandle FTM_SIMULATE_PARTICLES("Simulate Particles");
-
 void LLViewerPartSim::updateSimulation()
 {
+	LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("Simulate Particles");
 	static LLFrameTimer update_timer;
 
 	const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f);
@@ -667,8 +666,6 @@ void LLViewerPartSim::updateSimulation()
 		return;
 	}
 
-	LL_RECORD_BLOCK_TIME(FTM_SIMULATE_PARTICLES);
-
 	// Start at a random particle system so the same
 	// particle system doesn't always get first pick at the
 	// particles.  Theoretically we'd want to do this in distance
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 2f24c10ef7f..9020c371cbc 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -360,8 +360,8 @@ void update_statistics()
 	record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs);
 	record(LLStatViewer::NETWORK_STACKTIME, network_secs);
 	record(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Update Images")));
-	record(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Sort Draw State")));
-	record(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Render Geometry")));
+	record(LLStatViewer::REBUILD_STACKTIME, 0);
+	record(LLStatViewer::RENDER_STACKTIME, 0);
 		
 	if (gAgent.getRegion() && isAgentAvatarValid())
 	{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 65690846b2a..0793bdab5db 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -250,40 +250,6 @@ bool	gDebugPipeline = false;
 LLPipeline gPipeline;
 const LLMatrix4a* gGLLastMatrix = NULL;
 
-LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY("Render Geometry");
-LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS("Grass");
-LLTrace::BlockTimerStatHandle FTM_RENDER_INVISIBLE("Invisible");
-LLTrace::BlockTimerStatHandle FTM_RENDER_SHINY("Shiny");
-LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE("Simple");
-LLTrace::BlockTimerStatHandle FTM_RENDER_TERRAIN("Terrain");
-LLTrace::BlockTimerStatHandle FTM_RENDER_TREES("Trees");
-LLTrace::BlockTimerStatHandle FTM_RENDER_UI("UI");
-LLTrace::BlockTimerStatHandle FTM_RENDER_WATER("Water");
-LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY("Windlight Sky");
-LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA("Alpha Objects");
-LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS("Avatars");
-LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP("Bump");
-LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS("Render Materials");
-LLTrace::BlockTimerStatHandle FTM_RENDER_FULLBRIGHT("Fullbright");
-LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW("Glow");
-LLTrace::BlockTimerStatHandle FTM_GEO_UPDATE("Geo Update");
-LLTrace::BlockTimerStatHandle FTM_POOLRENDER("RenderPool");
-LLTrace::BlockTimerStatHandle FTM_POOLS("Pools");
-LLTrace::BlockTimerStatHandle FTM_DEFERRED_POOLRENDER("RenderPool (Deferred)");
-LLTrace::BlockTimerStatHandle FTM_DEFERRED_POOLS("Pools (Deferred)");
-LLTrace::BlockTimerStatHandle FTM_POST_DEFERRED_POOLRENDER("RenderPool (Post)");
-LLTrace::BlockTimerStatHandle FTM_POST_DEFERRED_POOLS("Pools (Post)");
-LLTrace::BlockTimerStatHandle FTM_STATESORT("Sort Draw State");
-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");
-
-static LLTrace::BlockTimerStatHandle FTM_STATESORT_DRAWABLE("Sort Drawables");
-
 static LLStaticHashedString sTint("tint");
 static LLStaticHashedString sAmbiance("ambiance");
 static LLStaticHashedString sAlphaScale("alpha_scale");
@@ -2539,8 +2505,6 @@ bool LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3&
 	return res;
 }
 
-static LLTrace::BlockTimerStatHandle FTM_CULL("Object Culling");
-
 void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, LLPlane* planep)
 {
 	static LLCachedControl<bool> use_occlusion(gSavedSettings,"UseOcclusion");
@@ -9867,17 +9831,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
     }
 }
 
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_RENDER("Render Shadows");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA("Alpha Shadow");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_SIMPLE("Simple Shadow");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_GEOM("Shadow Geom");
-
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA_MASKED("Alpha Masked");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA_BLEND("Alpha Blend");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA_TREE("Alpha Tree");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA_GRASS("Alpha Grass");
-static LLTrace::BlockTimerStatHandle FTM_SHADOW_FULLBRIGHT_ALPHA_MASKED("Fullbright Alpha Masked");
-
 void LLPipeline::renderShadow(const LLMatrix4a& view, const LLMatrix4a& proj, LLCamera& shadow_cam, LLCullResult &result, bool use_shader, bool use_occlusion, U32 target_width)
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; //LL_RECORD_BLOCK_TIME(FTM_SHADOW_RENDER);
@@ -10334,9 +10287,6 @@ LLRenderTarget* LLPipeline::getShadowTarget(U32 i)
     return &mShadow[i];
 }
 
-static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW("Gen Sun Shadow");
-static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW_SPOT_RENDER("Spot Shadow Render");
-
 void LLPipeline::generateSunShadow(LLCamera& camera)
 {
 	if (!sRenderDeferred || RenderShadowDetail <= 0)
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 72401e1050e..9510a40157e 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -64,31 +64,6 @@ bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3&
 bool setup_hud_matrices(); // use whole screen to render hud
 bool setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking)
 
-
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_INVISIBLE;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_SHINY;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_TERRAIN;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_TREES;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_WATER;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_FULLBRIGHT;
-extern LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW;
-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;
-
 class LLPipeline
 {
 public:
-- 
GitLab