Expose Renderer's Framecount

We don't want to move it, because we want to complete
this refactor without changing savestate version
This commit is contained in:
Scott Mansell 2023-01-31 01:03:46 +13:00
parent 3be63221c7
commit ec8f46b02c
4 changed files with 9 additions and 7 deletions

View File

@ -84,12 +84,12 @@ void Presenter::ViSwap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height,
present_info.emulated_timestamp = ticks;
if (unique)
{
present_info.frame_count = m_frame_count++;
present_info.frame_count = g_renderer->FrameCountIncrement();
present_info.reason = PresentInfo::PresentReason::VideoInterface;
}
else
{
present_info.frame_count = m_frame_count - 1;
present_info.frame_count = g_renderer->FrameCount() - 1; // Previous frame
present_info.reason = PresentInfo::PresentReason::VideoInterfaceDuplicate;
}
present_info.present_count = m_present_count;
@ -115,7 +115,7 @@ void Presenter::ImmediateSwap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_
PresentInfo present_info;
present_info.emulated_timestamp = ticks;
present_info.frame_count = m_frame_count++;
present_info.frame_count = g_renderer->FrameCountIncrement();
present_info.reason = PresentInfo::PresentReason::Immediate;
present_info.present_count = m_present_count++;
@ -145,7 +145,7 @@ void Presenter::ProcessFrameDumping(u64 ticks) const
}
g_frame_dumper->DumpCurrentFrame(m_xfb_entry->texture.get(), m_xfb_rect, target_rect, ticks,
m_frame_count);
g_renderer->FrameCount());
}
}

View File

@ -128,7 +128,6 @@ private:
std::unique_ptr<VideoCommon::PostProcessing> m_post_processor;
std::unique_ptr<VideoCommon::OnScreenUI> m_onscreen_ui;
u64 m_frame_count = 0;
u64 m_present_count = 0;
};

View File

@ -104,7 +104,8 @@ public:
bool CalculateTargetSize();
int m_frame_count = 0;
int FrameCount() const { return m_frame_count; }
int FrameCountIncrement() { return m_frame_count++; }
void OnConfigChanged(u32 bits);
@ -131,6 +132,8 @@ private:
u32 m_last_xfb_stride = 0;
u32 m_last_xfb_height = 0;
int m_frame_count = 0;
EventHook m_update_widescreen_handle;
EventHook m_config_changed_handle;
};

View File

@ -783,7 +783,7 @@ void TextureCacheBase::OnFrameEnd()
g_texture_cache->FlushEFBCopies();
}
g_texture_cache->Cleanup(g_renderer->m_frame_count);
g_texture_cache->Cleanup(g_renderer->FrameCount());
}
void TCacheEntry::DoState(PointerWrap& p)