chore: strip throwaway dense-town FPS profiling apparatus (plan Task 5)
The FPS deep-dive landed (dense Arwic 75 -> ~165 fps via the cell-object batching + cell-particle consolidation, both already committed). Remove the throwaway diagnostic apparatus now that it has served its purpose: - delete FrameProfiler.cs (whole-frame TimeElapsed + [PASS-GPU] glFinish + [CPU-PHASE]/[GPU-PHASE] timers + the =1/=2 ACDREAM_FPS_PROF modes) - GameWindow: _fpsProf/_frameProfiler/_msaaSamples fields, the BeginFrame/ EndFrame/MarkUpdateStart hooks, the terrain glFinish, and the landscape sub-phase LsMark instrumentation - RetailPViewRenderer: the DrawInside per-phase Phase()/MarkGpu markers - ParticleRenderer / PortalDepthMaskRenderer / EnvCellRenderer: the per-pass glFinish brackets - delete DegradeCoverageProbeTests.cs (the dead distance-degrade probe) KEPT (the real fixes): RetailPViewRenderer cell-object batching + consolidated cell-particle pass; EnvCellRenderer.CellHasTransparent. Build + full test suite green (468 App incl. pview replay tests; 1566 Core; 317 Net; 425 UI). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9f51a4db18
commit
a9d06a613a
7 changed files with 0 additions and 569 deletions
|
|
@ -62,20 +62,6 @@ public sealed class GameWindow : IDisposable
|
|||
private double _lastFps = 60.0;
|
||||
private double _lastFrameMs = 16.7;
|
||||
|
||||
// THROWAWAY FPS-investigation apparatus (2026-06-23):
|
||||
// frame-level CPU/GPU/wall profiler to find the dense-town bottleneck. See
|
||||
// FrameProfiler. Lazy-constructed on first OnRender once _gl is live.
|
||||
// ACDREAM_FPS_PROF=1 — whole-frame query + per-pass glFinish brackets
|
||||
// ([PASS-GPU]); the glFinish SERIALIZES the pipe so cpuRender/gpu/wall
|
||||
// collapse together — relative per-pass attribution only.
|
||||
// ACDREAM_FPS_PROF=2 — whole-frame TimeElapsed query ONLY, NO per-pass
|
||||
// glFinish (PassGpuEnabled stays "1"-gated). This is the honest CPU-vs-GPU
|
||||
// split: gpu≈wall+present>0 ⇒ GPU-bound; cpuRender≈wall+present≈0 ⇒ CPU-bound.
|
||||
private readonly bool _fpsProf =
|
||||
Environment.GetEnvironmentVariable("ACDREAM_FPS_PROF") is "1" or "2";
|
||||
private FrameProfiler? _frameProfiler;
|
||||
private int _msaaSamples;
|
||||
|
||||
// Phase I.2: per-frame counters surfaced through the ImGui DebugPanel
|
||||
// VM closures. Computed once per render pass alongside the frustum
|
||||
// walk + nearest-object scan; the VM closures just read the cached
|
||||
|
|
@ -990,8 +976,6 @@ public sealed class GameWindow : IDisposable
|
|||
var startupDisplay = startupStore.LoadDisplay();
|
||||
var startupBase = AcDream.UI.Abstractions.Settings.QualitySettings.From(startupDisplay.Quality);
|
||||
var startupQuality = AcDream.UI.Abstractions.Settings.QualitySettings.WithEnvOverrides(startupBase);
|
||||
_msaaSamples = startupQuality.MsaaSamples; // ACDREAM_FPS_PROF apparatus
|
||||
|
||||
var options = WindowOptions.Default with
|
||||
{
|
||||
Size = new Vector2D<int>(1280, 720),
|
||||
|
|
@ -7628,11 +7612,6 @@ public sealed class GameWindow : IDisposable
|
|||
|
||||
private void OnUpdate(double dt)
|
||||
{
|
||||
// THROWAWAY FPS apparatus (ACDREAM_FPS_PROF=1): stamp the start of the
|
||||
// update phase so the profiler can split frame time into update vs render
|
||||
// vs present. Robust to early-returns below (no matching EndUpdate needed).
|
||||
if (_fpsProf) _frameProfiler?.MarkUpdateStart();
|
||||
|
||||
// [FRAME-DIAG]: applies run later this frame inside _streamingController.Tick;
|
||||
// flush the PREVIOUS OnUpdate's accumulated apply cost here (a clean per-frame
|
||||
// boundary, independent of where in OnUpdate the applies landed) and reset.
|
||||
|
|
@ -8367,14 +8346,6 @@ public sealed class GameWindow : IDisposable
|
|||
|
||||
private void OnRender(double deltaSeconds)
|
||||
{
|
||||
// THROWAWAY FPS apparatus (ACDREAM_FPS_PROF=1): bracket the whole frame's
|
||||
// CPU (this method) + GPU (TimeElapsed query) work. Begin before any GL.
|
||||
if (_fpsProf && _gl is not null)
|
||||
{
|
||||
_frameProfiler ??= new FrameProfiler(_gl);
|
||||
_frameProfiler.BeginFrame();
|
||||
}
|
||||
|
||||
// Phase G.1: set the clear color from the current sky's fog
|
||||
// tint so the horizon band continues naturally past the
|
||||
// rendered geometry. Fog blends to this color at max distance
|
||||
|
|
@ -9427,11 +9398,6 @@ public sealed class GameWindow : IDisposable
|
|||
_imguiBootstrap.Render();
|
||||
}
|
||||
|
||||
// THROWAWAY FPS apparatus (ACDREAM_FPS_PROF=1): close the frame's CPU+GPU
|
||||
// brackets after ALL GL work (incl. ImGui). wall = the real frame period.
|
||||
if (_fpsProf && _frameProfiler is not null)
|
||||
_frameProfiler.EndFrame(deltaSeconds * 1000.0, _window!.VSync, _msaaSamples, deltaSeconds);
|
||||
|
||||
// Update the window title with performance stats every ~0.5s.
|
||||
_perfAccum += deltaSeconds;
|
||||
_perfFrameCount++;
|
||||
|
|
@ -10798,15 +10764,9 @@ public sealed class GameWindow : IDisposable
|
|||
AcDream.Core.Vfx.ParticleRenderPass.SkyPreScene);
|
||||
|
||||
EnableClipDistances();
|
||||
// THROWAWAY FPS apparatus: glFinish-bracket the PER-SLICE terrain draw so
|
||||
// [PASS-GPU] reports terrain ms/frame + calls/frame (= slice count). This
|
||||
// is the suspected multiplier: terrain is redrawn fully once per slice.
|
||||
System.Diagnostics.Stopwatch? _terrGpuSw = null;
|
||||
if (FrameProfiler.PassGpuEnabled) { _gl!.Finish(); _terrGpuSw = System.Diagnostics.Stopwatch.StartNew(); }
|
||||
_terrainCpuStopwatch.Restart();
|
||||
_terrain?.Draw(camera, frustum, neverCullLandblockId: playerLb);
|
||||
_terrainCpuStopwatch.Stop();
|
||||
if (_terrGpuSw is not null) { _gl!.Finish(); FrameProfiler.AddRendererGpu("terrain", _terrGpuSw.Elapsed.TotalMilliseconds); }
|
||||
_terrainCpuSamples[_terrainCpuSampleCursor] =
|
||||
(long)(_terrainCpuStopwatch.Elapsed.TotalMicroseconds * 100.0);
|
||||
_terrainCpuSampleCursor = (_terrainCpuSampleCursor + 1) % _terrainCpuSamples.Length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue