GPU: Show stats from previous frame if no rendering occured
This commit is contained in:
parent
c02cbc57e8
commit
69f6788f9f
|
@ -548,7 +548,7 @@ void SDLInterface::Run()
|
|||
{
|
||||
m_fps_counter++;
|
||||
const double time = m_fps_timer.GetTimeSeconds();
|
||||
if (time > 0.1)
|
||||
if (time >= 0.25f)
|
||||
{
|
||||
m_fps = static_cast<float>(m_fps_counter / time);
|
||||
m_fps_counter = 0;
|
||||
|
|
|
@ -37,33 +37,44 @@ void GPU_HW_OpenGL::RenderUI()
|
|||
{
|
||||
GPU_HW::RenderUI();
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(300.0f, 100.0f), ImGuiCond_Once);
|
||||
|
||||
const bool is_null_frame = m_stats.num_batches == 0;
|
||||
if (!is_null_frame)
|
||||
{
|
||||
m_last_stats = m_stats;
|
||||
m_stats = {};
|
||||
}
|
||||
|
||||
if (ImGui::Begin("GL Render Statistics"))
|
||||
{
|
||||
ImGui::Columns(2);
|
||||
ImGui::SetColumnWidth(0, 200.0f);
|
||||
|
||||
ImGui::TextUnformatted("Texture Page Updates:");
|
||||
ImGui::TextUnformatted("VRAM Read Texture Updates:");
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("%u", m_stats.num_vram_read_texture_updates);
|
||||
ImGui::Text("%u", m_last_stats.num_vram_read_texture_updates);
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::TextUnformatted("Batches Drawn:");
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("%u", m_stats.num_batches);
|
||||
ImGui::Text("%u", m_last_stats.num_batches);
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::TextUnformatted("Vertices Drawn: ");
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("%u", m_stats.num_vertices);
|
||||
ImGui::Text("%u", m_last_stats.num_vertices);
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::TextUnformatted("GPU Active In This Frame: ");
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("%s", is_null_frame ? "Yes" : "No");
|
||||
ImGui::NextColumn();
|
||||
|
||||
ImGui::Columns(1);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
// skip update when no batches were drawn in that frame.. for now
|
||||
if (m_stats.num_batches > 0)
|
||||
m_stats = {};
|
||||
}
|
||||
|
||||
void GPU_HW_OpenGL::InvalidateVRAMReadCache()
|
||||
|
|
|
@ -66,4 +66,5 @@ private:
|
|||
std::array<GL::Program, 3> m_texture_page_programs;
|
||||
|
||||
GLStats m_stats = {};
|
||||
GLStats m_last_stats = {};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue