update tracy from 11.0 to 13.1 and fix build with tracy enabled

This commit is contained in:
Sven Balzer
2026-05-01 18:24:04 +02:00
parent 7fa5294e02
commit 2adf75973a
304 changed files with 20579 additions and 170182 deletions
+2 -3
View File
@@ -9,7 +9,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 69 };
enum : uint32_t { ProtocolVersion = 76 };
enum : uint16_t { BroadcastVersion = 3 };
using lz4sz_t = uint32_t;
@@ -83,7 +83,7 @@ struct WelcomeFlag
enum _t : uint8_t
{
OnDemand = 1 << 0,
IsApple = 1 << 1,
IgnoreMemFaults = 1 << 1,
CodeTransfer = 1 << 2,
CombineSamples = 1 << 3,
IdentifySamples = 1 << 4,
@@ -95,7 +95,6 @@ struct WelcomeMessage
double timerMul;
int64_t initBegin;
int64_t initEnd;
uint64_t delay;
uint64_t resolution;
uint64_t epoch;
uint64_t exectime;
+55 -5
View File
@@ -42,6 +42,8 @@ enum class QueueType : uint8_t
MemAllocCallstackNamed,
MemFreeCallstack,
MemFreeCallstackNamed,
MemDiscard,
MemDiscardCallstack,
GpuZoneBegin,
GpuZoneBeginCallstack,
GpuZoneBeginAllocSrcLoc,
@@ -59,6 +61,7 @@ enum class QueueType : uint8_t
ThreadWakeup,
GpuTime,
GpuContextName,
GpuAnnotationName,
CallstackFrameSize,
SymbolInformation,
ExternalNameMetadata,
@@ -109,6 +112,7 @@ enum class QueueType : uint8_t
SecondStringData,
MemNamePayload,
ThreadGroupHint,
GpuZoneAnnotation,
StringData,
ThreadName,
PlotName,
@@ -329,7 +333,7 @@ struct QueuePlotDataInt : public QueuePlotDataBase
int64_t val;
};
struct QueuePlotDataFloat : public QueuePlotDataBase
struct QueuePlotDataFloat : public QueuePlotDataBase
{
float val;
};
@@ -401,7 +405,11 @@ enum class GpuContextType : uint8_t
Vulkan,
OpenCL,
Direct3D12,
Direct3D11
Direct3D11,
Metal,
Custom,
CUDA,
Rocprof
};
enum GpuContextFlags : uint8_t
@@ -441,6 +449,15 @@ struct QueueGpuZoneEnd
uint8_t context;
};
struct QueueGpuZoneAnnotation
{
int64_t noteId;
double value;
uint32_t thread;
uint16_t queryId;
uint8_t context;
};
struct QueueGpuTime
{
int64_t gpuTime;
@@ -462,7 +479,7 @@ struct QueueGpuTimeSync
int64_t cpuTime;
uint8_t context;
};
struct QueueGpuContextName
{
uint8_t context;
@@ -474,6 +491,18 @@ struct QueueGpuContextNameFat : public QueueGpuContextName
uint16_t size;
};
struct QueueGpuAnnotationName
{
int64_t noteId;
uint8_t context;
};
struct QueueGpuAnnotationNameFat : public QueueGpuAnnotationName
{
uint64_t ptr;
uint16_t size;
};
struct QueueMemNamePayload
{
uint64_t name;
@@ -500,6 +529,13 @@ struct QueueMemFree
uint64_t ptr;
};
struct QueueMemDiscard
{
int64_t time;
uint32_t thread;
uint64_t name;
};
struct QueueCallstackFat
{
uint64_t ptr;
@@ -593,14 +629,20 @@ struct QueueContextSwitch
uint32_t oldThread;
uint32_t newThread;
uint8_t cpu;
uint8_t reason;
uint8_t state;
uint8_t oldThreadWaitReason;
uint8_t oldThreadState;
uint8_t previousCState;
int8_t newThreadPriority;
int8_t oldThreadPriority;
};
struct QueueThreadWakeup
{
int64_t time;
uint32_t thread;
uint8_t cpu;
int8_t adjustReason;
int8_t adjustIncrement;
};
struct QueueTidToPid
@@ -738,8 +780,11 @@ struct QueueItem
QueueGpuTimeSync gpuTimeSync;
QueueGpuContextName gpuContextName;
QueueGpuContextNameFat gpuContextNameFat;
QueueGpuAnnotationName gpuAnnotationName;
QueueGpuAnnotationNameFat gpuAnnotationNameFat;
QueueMemAlloc memAlloc;
QueueMemFree memFree;
QueueMemDiscard memDiscard;
QueueMemNamePayload memName;
QueueThreadGroupHint threadGroupHint;
QueueCallstackFat callstackFat;
@@ -770,6 +815,7 @@ struct QueueItem
QueueSourceCodeNotAvailable sourceCodeNotAvailable;
QueueFiberEnter fiberEnter;
QueueFiberLeave fiberLeave;
QueueGpuZoneAnnotation zoneAnnotation;
};
};
#pragma pack( pop )
@@ -811,6 +857,8 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), // callstack, named
sizeof( QueueHeader ) + sizeof( QueueMemFree ), // callstack
sizeof( QueueHeader ) + sizeof( QueueMemFree ), // callstack, named
sizeof( QueueHeader ) + sizeof( QueueMemDiscard ),
sizeof( QueueHeader ) + sizeof( QueueMemDiscard ), // callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ),
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ), // callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBeginLean ),// allocated source location
@@ -828,6 +876,7 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueThreadWakeup ),
sizeof( QueueHeader ) + sizeof( QueueGpuTime ),
sizeof( QueueHeader ) + sizeof( QueueGpuContextName ),
sizeof( QueueHeader ) + sizeof( QueueGpuAnnotationName ),
sizeof( QueueHeader ) + sizeof( QueueCallstackFrameSize ),
sizeof( QueueHeader ) + sizeof( QueueSymbolInformation ),
sizeof( QueueHeader ), // ExternalNameMetadata - not for wire transfer
@@ -879,6 +928,7 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ), // second string data
sizeof( QueueHeader ) + sizeof( QueueMemNamePayload ),
sizeof( QueueHeader ) + sizeof( QueueThreadGroupHint ),
sizeof( QueueHeader ) + sizeof( QueueGpuZoneAnnotation ), // GPU zone annotation
// keep all QueueStringTransfer below
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // string data
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // thread name
+6 -4
View File
@@ -10,7 +10,7 @@
# endif
# include <windows.h>
# include <malloc.h>
# include "TracyUwp.hpp"
# include "TracyWinFamily.hpp"
#else
# include <pthread.h>
# include <string.h>
@@ -26,7 +26,9 @@
# include <fcntl.h>
#elif defined __FreeBSD__
# include <sys/thr.h>
#elif defined __NetBSD__ || defined __DragonFly__
#elif defined __NetBSD__
# include <lwp.h>
#elif defined __DragonFly__
# include <sys/lwp.h>
#elif defined __QNX__
# include <process.h>
@@ -135,7 +137,7 @@ TRACY_API void SetThreadName( const char* name )
TRACY_API void SetThreadNameWithHint( const char* name, int32_t groupHint )
{
#if defined _WIN32
# ifdef TRACY_UWP
# if defined TRACY_WIN32_NO_DESKTOP
static auto _SetThreadDescription = &::SetThreadDescription;
# else
static auto _SetThreadDescription = (t_SetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "SetThreadDescription" );
@@ -244,7 +246,7 @@ TRACY_API const char* GetThreadName( uint32_t id )
#endif
#if defined _WIN32
# ifdef TRACY_UWP
# if defined TRACY_WIN32_NO_DESKTOP
static auto _GetThreadDescription = &::GetThreadDescription;
# else
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
-11
View File
@@ -1,11 +0,0 @@
#ifndef __TRACYUWP_HPP__
#define __TRACYUWP_HPP__
#ifdef _WIN32
# include <winapifamily.h>
# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# define TRACY_UWP
# endif
#endif
#endif
+1 -1
View File
@@ -6,7 +6,7 @@ namespace tracy
namespace Version
{
enum { Major = 0 };
enum { Minor = 11 };
enum { Minor = 13 };
enum { Patch = 1 };
}
}
@@ -0,0 +1,16 @@
#ifndef __TRACYWINFAMILY_HPP__
#define __TRACYWINFAMILY_HPP__
#ifdef _WIN32
# include <winapifamily.h>
# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# define TRACY_WIN32_NO_DESKTOP
# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES)
# define TRACY_GDK
# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
# define TRACY_UWP
# endif
# endif
#endif
#endif