mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Add ETC1 compression thread.
This commit is contained in:
parent
f565e11976
commit
7ebd2162c6
@ -788,6 +788,7 @@ enum { QueuePrealloc = 256 * 1024 };
|
||||
|
||||
static Profiler* s_instance;
|
||||
static Thread* s_thread;
|
||||
static Thread* s_compressThread;
|
||||
|
||||
#ifdef TRACY_DELAYED_INIT
|
||||
struct ThreadNameData;
|
||||
@ -991,6 +992,10 @@ Profiler::Profiler()
|
||||
new(s_thread) Thread( LaunchWorker, this );
|
||||
SetThreadName( s_thread->Handle(), "Tracy Profiler" );
|
||||
|
||||
s_compressThread = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
new(s_compressThread) Thread( LaunchCompressWorker, this );
|
||||
SetThreadName( s_compressThread->Handle(), "Tracy Profiler ETC1" );
|
||||
|
||||
#if defined PTW32_VERSION
|
||||
s_profilerThreadId = pthread_getw32threadid_np( s_thread->Handle() );
|
||||
#elif defined __WINPTHREADS_VERSION
|
||||
@ -1027,6 +1032,8 @@ Profiler::Profiler()
|
||||
Profiler::~Profiler()
|
||||
{
|
||||
m_shutdown.store( true, std::memory_order_relaxed );
|
||||
s_compressThread->~Thread();
|
||||
tracy_free( s_compressThread );
|
||||
s_thread->~Thread();
|
||||
tracy_free( s_thread );
|
||||
|
||||
@ -1394,6 +1401,11 @@ void Profiler::Worker()
|
||||
}
|
||||
}
|
||||
|
||||
void Profiler::CompressWorker()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void FreeAssociatedMemory( const QueueItem& item )
|
||||
{
|
||||
if( item.hdr.idx >= (int)QueueType::Terminate ) return;
|
||||
|
@ -452,6 +452,9 @@ private:
|
||||
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
||||
void Worker();
|
||||
|
||||
static void LaunchCompressWorker( void* ptr ) { ((Profiler*)ptr)->CompressWorker(); }
|
||||
void CompressWorker();
|
||||
|
||||
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
||||
DequeueStatus Dequeue( tracy::moodycamel::ConsumerToken& token );
|
||||
DequeueStatus DequeueSerial();
|
||||
|
Loading…
Reference in New Issue
Block a user