diff --git a/public/common/TracySystem.cpp b/public/common/TracySystem.cpp index 4482d5f7..48dd42b7 100644 --- a/public/common/TracySystem.cpp +++ b/public/common/TracySystem.cpp @@ -104,6 +104,7 @@ TRACY_API uint32_t GetThreadHandleImpl() struct ThreadNameData { uint32_t id; + uint32_t groupHint; const char* name; ThreadNameData* next; }; @@ -134,6 +135,11 @@ void ThreadNameMsvcMagic( const THREADNAME_INFO& info ) #endif TRACY_API void SetThreadName( const char* name ) +{ + SetThreadNameWithHint( name, 0 ); +} + +TRACY_API void SetThreadNameWithHint( const char* name, uint32_t groupHint ) { #if defined _WIN32 # ifdef TRACY_UWP @@ -205,6 +211,7 @@ TRACY_API void SetThreadName( const char* name ) buf[sz] = '\0'; auto data = (ThreadNameData*)tracy_malloc_fast( sizeof( ThreadNameData ) ); data->id = detail::GetThreadHandleImpl(); + data->groupHint = groupHint; data->name = buf; data->next = GetThreadNameData().load( std::memory_order_relaxed ); while( !GetThreadNameData().compare_exchange_weak( data->next, data, std::memory_order_release, std::memory_order_relaxed ) ) {} diff --git a/public/common/TracySystem.hpp b/public/common/TracySystem.hpp index aa5a88c1..5f1e64ec 100644 --- a/public/common/TracySystem.hpp +++ b/public/common/TracySystem.hpp @@ -23,6 +23,7 @@ static inline uint32_t GetThreadHandle() #endif TRACY_API void SetThreadName( const char* name ); +TRACY_API void SetThreadNameWithHint( const char* name, uint32_t groupHint ); TRACY_API const char* GetThreadName( uint32_t id ); TRACY_API const char* GetEnvVar( const char* name );