diff --git a/profiler/src/profiler/TracyView_ZoneInfo.cpp b/profiler/src/profiler/TracyView_ZoneInfo.cpp index a466bf2c..0f5ff3c1 100644 --- a/profiler/src/profiler/TracyView_ZoneInfo.cpp +++ b/profiler/src/profiler/TracyView_ZoneInfo.cpp @@ -2025,12 +2025,6 @@ void View::ZoneTooltip( const GpuEvent& ev ) } } - ImGui::Separator(); - TextDisabledUnformatted( "GPU zone debug" ); - TextFocused( "GPU begin (Tracy ns):", RealToString( ev.GpuStart() ) ); - TextFocused( "GPU end (Tracy ns):", RealToString( end ) ); - TextFocused( "Begin query id:", RealToString( ev.query_id ) ); - ImGui::EndTooltip(); } diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index a44e255e..7d527517 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -84,8 +84,6 @@ #include "TracySysTrace.hpp" #include "../tracy/TracyC.h" -#include "../tracy/Tracy.hpp" - #if defined TRACY_MANUAL_LIFETIME && !defined(TRACY_DELAYED_INIT) # error "TRACY_MANUAL_LIFETIME requires enabled TRACY_DELAYED_INIT" #endif diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index d8dbad88..075479a5 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -380,19 +380,9 @@ struct GpuEvent tracy_force_inline int64_t CpuEnd() const { return int64_t( _cpuEnd_thread ) >> 16; } tracy_force_inline void SetCpuEnd( int64_t cpuEnd ) { assert( cpuEnd < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_cpuEnd_thread)+2, &cpuEnd, 4 ); memcpy( ((char*)&_cpuEnd_thread)+6, ((char*)&cpuEnd)+4, 2 ); } tracy_force_inline int64_t GpuStart() const { return int64_t( _gpuStart_child1 ) >> 16; } - tracy_force_inline void SetGpuStart( int64_t gpuStart ) - { - assert( gpuStart < (int64_t)( 1ull << 47 ) ); - memcpy( ((char*)&_gpuStart_child1)+2, &gpuStart, 4 ); - memcpy( ((char*)&_gpuStart_child1)+6, ((char*)&gpuStart)+4, 2 ); - } + tracy_force_inline void SetGpuStart( int64_t gpuStart ) { /*assert( gpuStart < (int64_t)( 1ull << 47 ) );*/ memcpy( ((char*)&_gpuStart_child1)+2, &gpuStart, 4 ); memcpy( ((char*)&_gpuStart_child1)+6, ((char*)&gpuStart)+4, 2 ); } tracy_force_inline int64_t GpuEnd() const { return int64_t( _gpuEnd_child2 ) >> 16; } - tracy_force_inline void SetGpuEnd( int64_t gpuEnd ) - { - assert( gpuEnd < (int64_t)( 1ull << 47 ) ); - memcpy( ((char*)&_gpuEnd_child2)+2, &gpuEnd, 4 ); - memcpy( ((char*)&_gpuEnd_child2)+6, ((char*)&gpuEnd)+4, 2 ); - } + tracy_force_inline void SetGpuEnd( int64_t gpuEnd ) { assert( gpuEnd < (int64_t)( 1ull << 47 ) ); memcpy( ((char*)&_gpuEnd_child2)+2, &gpuEnd, 4 ); memcpy( ((char*)&_gpuEnd_child2)+6, ((char*)&gpuEnd)+4, 2 ); } tracy_force_inline int16_t SrcLoc() const { return int16_t( _cpuStart_srcloc & 0xFFFF ); } tracy_force_inline void SetSrcLoc( int16_t srcloc ) { memcpy( &_cpuStart_srcloc, &srcloc, 2 ); } tracy_force_inline uint16_t Thread() const { return uint16_t( _cpuEnd_thread & 0xFFFF ); } diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 7821899c..21bd21ba 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -5924,7 +5924,7 @@ void Worker::ProcessGpuZoneEnd( const QueueGpuZoneEnd& ev, bool serial ) assert( !td->second.stack.empty() ); auto zone = td->second.stack.back_and_pop(); - assert( !ctx->query[ev.queryId] ); + assert( !ctx->query[ev.queryId] ); ctx->query[ev.queryId] = zone; int64_t cpuTime; @@ -5946,16 +5946,8 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev ) auto ctx = m_gpuCtxMap[ev.context]; assert( ctx ); - if (ev.gpuTime < -1'000'000'000) - __debugbreak(); - int64_t tgpu = RefTime( m_refTimeGpu, ev.gpuTime ); - - // This overflow logic is for detecting "backward time jumps" due to asynchronous - // GPU scheduling (commands being rescheduled internally by the command processor, - // instead of being forced to execute in submit queue order) - constexpr int64_t gracePeriod = ( 1u << 31 ); // 2^31 ticks (about 2s, when 1 tick = 1ns) - if( tgpu < ctx->lastGpuTime - gracePeriod ) + if( tgpu < ctx->lastGpuTime - ( 1u << 31 ) ) { if( ctx->overflow == 0 ) { @@ -5963,6 +5955,7 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev ) } ctx->overflowMul++; } + ctx->lastGpuTime = tgpu; if( ctx->overflow != 0 ) { tgpu += ctx->overflow * ctx->overflowMul;