1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Provide macros for async-or-sync queue insertion.

If fibers are enabled, then some events which were traditionally stored in
async queues will have to be serialized. These macros provide the needed
infrastructure for this.
This commit is contained in:
Bartosz Taudul
2021-10-09 14:55:32 +02:00
parent 250ef2cf6e
commit 6411b35d68
+13
View File
@@ -105,6 +105,19 @@ struct LuaZoneState
__tail.store( __magic + 1, std::memory_order_release );
#ifdef TRACY_FIBERS
# define TracyQueuePrepare( _type ) \
auto item = Profiler::QueueSerial(); \
MemWrite( &item->hdr.type, _type );
# define TracyQueueCommit( _name ) \
MemWrite( &item->_name.thread, GetThreadHandle() ); \
Profiler::QueueSerialFinish();
#else
# define TracyQueuePrepare( _type ) TracyLfqPrepare( _type )
# define TracyQueueCommit( _name ) TracyLfqCommit
#endif
typedef void(*ParameterCallback)( uint32_t idx, int32_t val );
class Profiler