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
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

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