mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add user data pointer to parameter callback.
This commit is contained in:
parent
655d8a01ea
commit
72b7d0db5b
@ -3796,7 +3796,7 @@ void Profiler::HandleParameter( uint64_t payload )
|
|||||||
assert( m_paramCallback );
|
assert( m_paramCallback );
|
||||||
const auto idx = uint32_t( payload >> 32 );
|
const auto idx = uint32_t( payload >> 32 );
|
||||||
const auto val = int32_t( payload & 0xFFFFFFFF );
|
const auto val = int32_t( payload & 0xFFFFFFFF );
|
||||||
m_paramCallback( idx, val );
|
m_paramCallback( m_paramCallbackData, idx, val );
|
||||||
AckServerQuery();
|
AckServerQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ struct LuaZoneState
|
|||||||
#endif
|
#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 );
|
typedef char*(*SourceContentsCallback)( void* data, const char* filename, size_t& size );
|
||||||
|
|
||||||
class Profiler
|
class Profiler
|
||||||
@ -619,7 +619,13 @@ public:
|
|||||||
#endif
|
#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 )
|
static tracy_force_inline void ParameterSetup( uint32_t idx, const char* name, bool isBool, int32_t val )
|
||||||
{
|
{
|
||||||
TracyLfqPrepare( QueueType::ParamSetup );
|
TracyLfqPrepare( QueueType::ParamSetup );
|
||||||
@ -936,6 +942,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ParameterCallback m_paramCallback;
|
ParameterCallback m_paramCallback;
|
||||||
|
void* m_paramCallbackData;
|
||||||
SourceContentsCallback m_sourceCallback;
|
SourceContentsCallback m_sourceCallback;
|
||||||
void* m_sourceCallbackData;
|
void* m_sourceCallbackData;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
#define TracyMessageLCS(x,y,z)
|
#define TracyMessageLCS(x,y,z)
|
||||||
|
|
||||||
#define TracySourceCallbackRegister(x,y)
|
#define TracySourceCallbackRegister(x,y)
|
||||||
#define TracyParameterRegister(x)
|
#define TracyParameterRegister(x,y)
|
||||||
#define TracyParameterSetup(x,y,z,w)
|
#define TracyParameterSetup(x,y,z,w)
|
||||||
#define TracyIsConnected false
|
#define TracyIsConnected false
|
||||||
|
|
||||||
@ -255,7 +255,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TracySourceCallbackRegister( cb, data ) tracy::Profiler::SourceCallbackRegister( cb, data )
|
#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 TracyParameterSetup( idx, name, isBool, val ) tracy::Profiler::ParameterSetup( idx, name, isBool, val )
|
||||||
#define TracyIsConnected tracy::GetProfiler().IsConnected()
|
#define TracyIsConnected tracy::GetProfiler().IsConnected()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user