diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index 8f5c210a..90cc0077 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -3796,7 +3796,7 @@ void Profiler::HandleParameter( uint64_t payload ) assert( m_paramCallback ); const auto idx = uint32_t( payload >> 32 ); const auto val = int32_t( payload & 0xFFFFFFFF ); - m_paramCallback( idx, val ); + m_paramCallback( m_paramCallbackData, idx, val ); AckServerQuery(); } diff --git a/public/client/TracyProfiler.hpp b/public/client/TracyProfiler.hpp index 269285ea..2c3f541d 100644 --- a/public/client/TracyProfiler.hpp +++ b/public/client/TracyProfiler.hpp @@ -149,7 +149,7 @@ struct LuaZoneState #endif -typedef void(*ParameterCallback)( uint32_t idx, int32_t val ); +typedef void(*ParameterCallback)( void* data, uint32_t idx, int32_t val ); typedef char*(*SourceContentsCallback)( void* data, const char* filename, size_t& size ); class Profiler @@ -619,7 +619,13 @@ public: #endif } - static tracy_force_inline void ParameterRegister( ParameterCallback cb ) { GetProfiler().m_paramCallback = cb; } + static tracy_force_inline void ParameterRegister( ParameterCallback cb, void* data ) + { + auto& profiler = GetProfiler(); + profiler.m_paramCallback = cb; + profiler.m_paramCallbackData = data; + } + static tracy_force_inline void ParameterSetup( uint32_t idx, const char* name, bool isBool, int32_t val ) { TracyLfqPrepare( QueueType::ParamSetup ); @@ -936,6 +942,7 @@ private: #endif ParameterCallback m_paramCallback; + void* m_paramCallbackData; SourceContentsCallback m_sourceCallback; void* m_sourceCallbackData; diff --git a/public/tracy/Tracy.hpp b/public/tracy/Tracy.hpp index 1c1d7422..cd7e085d 100644 --- a/public/tracy/Tracy.hpp +++ b/public/tracy/Tracy.hpp @@ -94,7 +94,7 @@ #define TracyMessageLCS(x,y,z) #define TracySourceCallbackRegister(x,y) -#define TracyParameterRegister(x) +#define TracyParameterRegister(x,y) #define TracyParameterSetup(x,y,z,w) #define TracyIsConnected false @@ -255,7 +255,7 @@ #endif #define TracySourceCallbackRegister( cb, data ) tracy::Profiler::SourceCallbackRegister( cb, data ) -#define TracyParameterRegister( cb ) tracy::Profiler::ParameterRegister( cb ) +#define TracyParameterRegister( cb, data ) tracy::Profiler::ParameterRegister( cb, data ) #define TracyParameterSetup( idx, name, isBool, val ) tracy::Profiler::ParameterSetup( idx, name, isBool, val ) #define TracyIsConnected tracy::GetProfiler().IsConnected()