1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Remove GPU resync support.

The whole concept is not really reliable. And it forces CPU to GPU sync,
which is bad.
This commit is contained in:
Bartosz Taudul 2018-06-22 16:34:51 +02:00
parent 62267399bc
commit af0c64c888
4 changed files with 0 additions and 63 deletions

View File

@ -122,19 +122,6 @@ public:
tail.store( magic + 1, std::memory_order_release );
m_tail = ( m_tail + 1 ) % QueryCount;
}
{
int64_t tgpu;
glGetInteger64v( GL_TIMESTAMP, &tgpu );
int64_t tcpu = Profiler::GetTime();
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::GpuResync );
MemWrite( &item->gpuResync.cpuTime, tcpu );
MemWrite( &item->gpuResync.gpuTime, tgpu );
MemWrite( &item->gpuResync.context, m_context );
tail.store( magic + 1, std::memory_order_release );
}
}
private:

View File

@ -34,7 +34,6 @@ enum class QueueType : uint8_t
GpuZoneBeginCallstack,
GpuZoneEnd,
GpuTime,
GpuResync,
MemAlloc,
MemFree,
MemAllocCallstack,
@ -195,13 +194,6 @@ struct QueueGpuTime
uint8_t context;
};
struct QueueGpuResync
{
int64_t cpuTime;
int64_t gpuTime;
uint8_t context;
};
struct QueueMemAlloc
{
int64_t time;
@ -267,7 +259,6 @@ struct QueueItem
QueueGpuZoneBegin gpuZoneBegin;
QueueGpuZoneEnd gpuZoneEnd;
QueueGpuTime gpuTime;
QueueGpuResync gpuResync;
QueueMemAlloc memAlloc;
QueueMemFree memFree;
QueueCallstackMemory callstackMemory;
@ -308,7 +299,6 @@ static const size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ), // callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneEnd ),
sizeof( QueueHeader ) + sizeof( QueueGpuTime ),
sizeof( QueueHeader ) + sizeof( QueueGpuResync ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ),
sizeof( QueueHeader ) + sizeof( QueueMemFree ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), // callstack

View File

@ -1570,9 +1570,6 @@ void Worker::Process( const QueueItem& ev )
case QueueType::GpuTime:
ProcessGpuTime( ev.gpuTime );
break;
case QueueType::GpuResync:
ProcessGpuResync( ev.gpuResync );
break;
case QueueType::MemAlloc:
ProcessMemAlloc( ev.memAlloc );
break;
@ -2063,42 +2060,6 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev )
}
}
void Worker::ProcessGpuResync( const QueueGpuResync& ev )
{
auto ctx = m_gpuCtxMap[ev.context];
assert( ctx );
int64_t gpuTime;
if( ctx->period == 1.f )
{
gpuTime = ev.gpuTime;
}
else
{
gpuTime = int64_t( double( ctx->period ) * ev.gpuTime ); // precision loss
}
const auto timeDiff = TscTime( ev.cpuTime ) - gpuTime;
if( ctx->queue.empty() )
{
assert( ctx->resync.empty() );
ctx->timeDiff = timeDiff;
}
else
{
if( ctx->resync.empty() )
{
ctx->resync.push_back( { timeDiff, uint16_t( ctx->queue.size() ) } );
}
else
{
const auto last = ctx->resync.back().events;
ctx->resync.push_back( { timeDiff, uint16_t( ctx->queue.size() - last ) } );
}
}
}
void Worker::ProcessMemAlloc( const QueueMemAlloc& ev )
{
const auto time = TscTime( ev.time );

View File

@ -234,7 +234,6 @@ private:
tracy_force_inline void ProcessGpuZoneBeginCallstack( const QueueGpuZoneBegin& ev );
tracy_force_inline void ProcessGpuZoneEnd( const QueueGpuZoneEnd& ev );
tracy_force_inline void ProcessGpuTime( const QueueGpuTime& ev );
tracy_force_inline void ProcessGpuResync( const QueueGpuResync& ev );
tracy_force_inline void ProcessMemAlloc( const QueueMemAlloc& ev );
tracy_force_inline void ProcessMemFree( const QueueMemFree& ev );
tracy_force_inline void ProcessMemAllocCallstack( const QueueMemAlloc& ev );