mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add serial queue to profiler.
This commit is contained in:
parent
0a3e9f85eb
commit
faeecdd773
@ -108,7 +108,7 @@ struct ThreadNameData;
|
||||
std::atomic<ThreadNameData*> init_order(104) s_threadNameData( nullptr );
|
||||
#endif
|
||||
|
||||
static Profiler init_order(105) s_profiler;
|
||||
Profiler init_order(105) s_profiler;
|
||||
|
||||
|
||||
enum { BulkSize = TargetFrameSize / QueueItemSize };
|
||||
@ -125,6 +125,7 @@ Profiler::Profiler()
|
||||
, m_bufferStart( 0 )
|
||||
, m_itemBuf( (QueueItem*)tracy_malloc( sizeof( QueueItem ) * BulkSize ) )
|
||||
, m_lz4Buf( (char*)tracy_malloc( LZ4Size + sizeof( lz4sz_t ) ) )
|
||||
, m_serialQueue( 1024*1024 )
|
||||
{
|
||||
assert( !s_instance );
|
||||
s_instance = this;
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "concurrentqueue.h"
|
||||
#include "TracyFastVector.hpp"
|
||||
#include "../common/tracy_lz4.hpp"
|
||||
#include "../common/tracy_benaphore.h"
|
||||
#include "../common/TracyQueue.hpp"
|
||||
#include "../common/TracyAlign.hpp"
|
||||
#include "../common/TracyAlloc.hpp"
|
||||
@ -50,6 +52,9 @@ struct GpuCtxWrapper
|
||||
|
||||
using Magic = moodycamel::ConcurrentQueueDefaultTraits::index_t;
|
||||
|
||||
class Profiler;
|
||||
extern Profiler s_profiler;
|
||||
|
||||
class Profiler
|
||||
{
|
||||
public:
|
||||
@ -252,6 +257,9 @@ private:
|
||||
|
||||
QueueItem* m_itemBuf;
|
||||
char* m_lz4Buf;
|
||||
|
||||
FastVector<QueueItem> m_serialQueue;
|
||||
NonRecursiveBenaphore m_serialLock;
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user