mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +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 Profiler* s_instance;
|
||||||
static Thread* s_thread;
|
static Thread* s_thread;
|
||||||
|
static Thread* s_compressThread;
|
||||||
|
|
||||||
#ifdef TRACY_DELAYED_INIT
|
#ifdef TRACY_DELAYED_INIT
|
||||||
struct ThreadNameData;
|
struct ThreadNameData;
|
||||||
@ -991,6 +992,10 @@ Profiler::Profiler()
|
|||||||
new(s_thread) Thread( LaunchWorker, this );
|
new(s_thread) Thread( LaunchWorker, this );
|
||||||
SetThreadName( s_thread->Handle(), "Tracy Profiler" );
|
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
|
#if defined PTW32_VERSION
|
||||||
s_profilerThreadId = pthread_getw32threadid_np( s_thread->Handle() );
|
s_profilerThreadId = pthread_getw32threadid_np( s_thread->Handle() );
|
||||||
#elif defined __WINPTHREADS_VERSION
|
#elif defined __WINPTHREADS_VERSION
|
||||||
@ -1027,6 +1032,8 @@ Profiler::Profiler()
|
|||||||
Profiler::~Profiler()
|
Profiler::~Profiler()
|
||||||
{
|
{
|
||||||
m_shutdown.store( true, std::memory_order_relaxed );
|
m_shutdown.store( true, std::memory_order_relaxed );
|
||||||
|
s_compressThread->~Thread();
|
||||||
|
tracy_free( s_compressThread );
|
||||||
s_thread->~Thread();
|
s_thread->~Thread();
|
||||||
tracy_free( s_thread );
|
tracy_free( s_thread );
|
||||||
|
|
||||||
@ -1394,6 +1401,11 @@ void Profiler::Worker()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Profiler::CompressWorker()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void FreeAssociatedMemory( const QueueItem& item )
|
static void FreeAssociatedMemory( const QueueItem& item )
|
||||||
{
|
{
|
||||||
if( item.hdr.idx >= (int)QueueType::Terminate ) return;
|
if( item.hdr.idx >= (int)QueueType::Terminate ) return;
|
||||||
|
@ -452,6 +452,9 @@ private:
|
|||||||
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
|
||||||
void Worker();
|
void Worker();
|
||||||
|
|
||||||
|
static void LaunchCompressWorker( void* ptr ) { ((Profiler*)ptr)->CompressWorker(); }
|
||||||
|
void CompressWorker();
|
||||||
|
|
||||||
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
||||||
DequeueStatus Dequeue( tracy::moodycamel::ConsumerToken& token );
|
DequeueStatus Dequeue( tracy::moodycamel::ConsumerToken& token );
|
||||||
DequeueStatus DequeueSerial();
|
DequeueStatus DequeueSerial();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user