Only retrieve frame offset internally in GetFrameNumber().

This commit is contained in:
Bartosz Taudul 2023-03-04 00:32:15 +01:00
parent 8164b776fd
commit f9449bc938
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
4 changed files with 6 additions and 5 deletions

View File

@ -316,7 +316,7 @@ private:
const GpuCtxData* GetZoneCtx( const GpuEvent& zone ) const;
bool FindMatchingZone( int prev0, int prev1, int flags );
const ZoneEvent* FindZoneAtTime( uint64_t thread, int64_t time ) const;
uint64_t GetFrameNumber( const FrameData& fd, int i, uint64_t offset ) const;
uint64_t GetFrameNumber( const FrameData& fd, int i ) const;
const char* GetFrameText( const FrameData& fd, int i, uint64_t ftime ) const;
const char* GetFrameSetName( const FrameData& fd ) const;
static const char* GetFrameSetName( const FrameData& fd, const Worker& worker );

View File

@ -141,7 +141,7 @@ void View::DrawFrames()
}
else
{
const auto fnum = GetFrameNumber( *m_frames, sel, m_worker.GetFrameOffset() );
const auto fnum = GetFrameNumber( *m_frames, sel );
m_frameHover = sel;
if( m_frames->name == 0 )
{

View File

@ -194,7 +194,7 @@ void View::DrawPlayback()
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
TextFocused( "Frame:", RealToString( GetFrameNumber( *frameSet, fi->frameRef, m_worker.GetFrameOffset() ) ) );
TextFocused( "Frame:", RealToString( GetFrameNumber( *frameSet, fi->frameRef ) ) );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();

View File

@ -749,10 +749,11 @@ int64_t View::AdjustGpuTime( int64_t time, int64_t begin, int drift )
return time + t / 1000000000 * drift;
}
uint64_t View::GetFrameNumber( const FrameData& fd, int i, uint64_t offset ) const
uint64_t View::GetFrameNumber( const FrameData& fd, int i ) const
{
if( fd.name == 0 )
{
const auto offset = m_worker.GetFrameOffset();
if( offset == 0 )
{
return i;
@ -770,7 +771,7 @@ uint64_t View::GetFrameNumber( const FrameData& fd, int i, uint64_t offset ) con
const char* View::GetFrameText( const FrameData& fd, int i, uint64_t ftime ) const
{
const auto fnum = GetFrameNumber( fd, i, m_worker.GetFrameOffset() );
const auto fnum = GetFrameNumber( fd, i );
static char buf[1024];
if( fd.name == 0 )
{