Add serial queue to profiler.

This commit is contained in:
Bartosz Taudul 2018-04-01 19:53:05 +02:00
parent 0a3e9f85eb
commit faeecdd773
2 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -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;
};
};