添加Tracy0.11的性能分析支持

This commit is contained in:
2025-11-27 17:18:30 +08:00
parent 92c5c7f795
commit 0d856db69a
56 changed files with 4045 additions and 505 deletions

38
ThirdParty/tracy-0.11/ProfilerZone.cs vendored Normal file
View File

@@ -0,0 +1,38 @@
using System;
using static Tracy.PInvoke;
public readonly struct ProfilerZone : IDisposable
{
public readonly TracyCZoneCtx Context;
public uint Id => Context.Data.Id;
public int Active => Context.Data.Active;
internal ProfilerZone(TracyCZoneCtx context)
{
Context = context;
}
public void EmitName(string name)
{
using var namestr = Profiler.GetCString(name, out var nameln);
TracyEmitZoneName(Context, namestr, nameln);
}
public void EmitColor(uint color)
{
TracyEmitZoneColor(Context, color);
}
public void EmitText(string text)
{
using var textstr = Profiler.GetCString(text, out var textln);
TracyEmitZoneText(Context, textstr, textln);
}
public void Dispose()
{
TracyEmitZoneEnd(Context);
}
}