perf(diagnostics): expose prepared asset source counters
This commit is contained in:
parent
230a7df454
commit
b1ad4b7c0a
5 changed files with 30 additions and 8 deletions
|
|
@ -901,7 +901,8 @@ internal sealed class LivePresentationCompositionPhase
|
|||
foundation.Terrain,
|
||||
foundation.SceneLighting,
|
||||
foundation.MeshAdapter,
|
||||
foundation.TextureCache)
|
||||
foundation.TextureCache,
|
||||
content.PreparedAssets)
|
||||
: null;
|
||||
var frameDiagnostics = new RenderFrameDiagnosticsController(
|
||||
new RuntimeRenderFrameTitleFactsSource(
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using AcDream.App.Rendering.Vfx;
|
|||
using AcDream.App.Rendering.Wb;
|
||||
using AcDream.App.Streaming;
|
||||
using AcDream.App.World;
|
||||
using AcDream.Content;
|
||||
using AcDream.Core.Physics;
|
||||
using AcDream.Core.Vfx;
|
||||
using AcDream.Core.World;
|
||||
|
|
@ -61,6 +62,7 @@ internal sealed class RuntimeRenderFrameResourceDiagnosticsSource :
|
|||
private readonly SceneLightingUboBinding? _lighting;
|
||||
private readonly WbMeshAdapter? _meshes;
|
||||
private readonly TextureCache? _textures;
|
||||
private readonly IPreparedAssetSource? _preparedAssets;
|
||||
|
||||
public RuntimeRenderFrameResourceDiagnosticsSource(
|
||||
ParticleSystem? particles,
|
||||
|
|
@ -74,7 +76,8 @@ internal sealed class RuntimeRenderFrameResourceDiagnosticsSource :
|
|||
TerrainModernRenderer? terrain,
|
||||
SceneLightingUboBinding? lighting,
|
||||
WbMeshAdapter? meshes,
|
||||
TextureCache? textures)
|
||||
TextureCache? textures,
|
||||
IPreparedAssetSource? preparedAssets)
|
||||
{
|
||||
_particles = particles;
|
||||
_particleBindings = particleBindings;
|
||||
|
|
@ -88,6 +91,7 @@ internal sealed class RuntimeRenderFrameResourceDiagnosticsSource :
|
|||
_lighting = lighting;
|
||||
_meshes = meshes;
|
||||
_textures = textures;
|
||||
_preparedAssets = preparedAssets;
|
||||
}
|
||||
|
||||
public RenderFrameResourceDiagnosticsSnapshot Capture()
|
||||
|
|
@ -98,6 +102,8 @@ internal sealed class RuntimeRenderFrameResourceDiagnosticsSource :
|
|||
var mesh = meshManager?.Diagnostics ?? default;
|
||||
var globalMesh = meshManager?.GlobalBuffer;
|
||||
var cpuMesh = _meshes?.CpuMeshCacheDiagnostics ?? default;
|
||||
PreparedAssetSourceStats prepared =
|
||||
_preparedAssets?.Stats ?? default;
|
||||
GCMemoryInfo gc = GC.GetGCMemoryInfo();
|
||||
|
||||
return new RenderFrameResourceDiagnosticsSnapshot(
|
||||
|
|
@ -141,7 +147,12 @@ internal sealed class RuntimeRenderFrameResourceDiagnosticsSource :
|
|||
_meshes?.LastMipmapBytes ?? 0,
|
||||
globalMesh?.CapacityBytes ?? 0,
|
||||
globalMesh?.PhysicalCapacityBytes ?? 0,
|
||||
globalMesh?.IsMigrationInProgress ?? false),
|
||||
globalMesh?.IsMigrationInProgress ?? false,
|
||||
prepared.Probes,
|
||||
prepared.Reads,
|
||||
prepared.Loaded,
|
||||
prepared.Missing,
|
||||
prepared.Corrupt),
|
||||
new TextureStreamResourceDiagnostics(
|
||||
_textures?.OwnedBindlessTextureCount ?? 0,
|
||||
_textures?.TextureOwnerCount ?? 0,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,12 @@ internal readonly record struct MeshStreamResourceDiagnostics(
|
|||
long FrameMipmapBytes,
|
||||
long GlobalCapacityBytes,
|
||||
long GlobalPhysicalCapacityBytes,
|
||||
bool GlobalMigrationInProgress);
|
||||
bool GlobalMigrationInProgress,
|
||||
long PreparedProbes,
|
||||
long PreparedReads,
|
||||
long PreparedLoaded,
|
||||
long PreparedMissing,
|
||||
long PreparedCorrupt);
|
||||
|
||||
internal readonly record struct TextureStreamResourceDiagnostics(
|
||||
int OwnedBindlessTextures,
|
||||
|
|
@ -254,6 +259,8 @@ internal sealed class RenderFrameDiagnosticsController :
|
|||
+ $"mipmapFrame={mesh.FrameMipmapArrayCount}/{mesh.FrameMipmapBytes} "
|
||||
+ $"meshCap={mesh.GlobalCapacityBytes} "
|
||||
+ $"meshPhys={mesh.GlobalPhysicalCapacityBytes}/{mesh.GlobalMigrationInProgress} "
|
||||
+ $"prepared={mesh.PreparedProbes}/{mesh.PreparedReads}/"
|
||||
+ $"{mesh.PreparedLoaded}/{mesh.PreparedMissing}/{mesh.PreparedCorrupt} "
|
||||
+ $"gpuTrack={process.TrackedGpuBytes}/{process.TrackedGpuBuffers}/"
|
||||
+ $"{process.TrackedGpuTextures} "
|
||||
+ $"managed={process.ManagedBytes}/{process.ManagedCommittedBytes} "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue