diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index c37447f1b..2a776d74e 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -78,7 +78,7 @@ void GPU_HW_OpenGL::DrawRendererStatsWindow() { GPU_HW::DrawRendererStatsWindow(); - ImGui::SetNextWindowSize(ImVec2(300.0f, 130.0f), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowSize(ImVec2(300.0f, 150.0f), ImGuiCond_FirstUseEver); const bool is_null_frame = m_stats.num_batches == 0; if (!is_null_frame) @@ -92,6 +92,21 @@ void GPU_HW_OpenGL::DrawRendererStatsWindow() ImGui::Columns(2); ImGui::SetColumnWidth(0, 200.0f); + ImGui::TextUnformatted("GPU Active In This Frame: "); + ImGui::NextColumn(); + ImGui::Text("%s", is_null_frame ? "Yes" : "No"); + ImGui::NextColumn(); + + ImGui::TextUnformatted("VRAM Reads: "); + ImGui::NextColumn(); + ImGui::Text("%u", m_last_stats.num_vram_reads); + ImGui::NextColumn(); + + ImGui::TextUnformatted("VRAM Writes: "); + ImGui::NextColumn(); + ImGui::Text("%u", m_last_stats.num_vram_writes); + ImGui::NextColumn(); + ImGui::TextUnformatted("VRAM Read Texture Updates:"); ImGui::NextColumn(); ImGui::Text("%u", m_last_stats.num_vram_read_texture_updates); @@ -107,10 +122,7 @@ void GPU_HW_OpenGL::DrawRendererStatsWindow() 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::End(); @@ -510,6 +522,8 @@ void GPU_HW_OpenGL::ReadVRAM(u32 x, u32 y, u32 width, u32 height, void* buffer) source_ptr -= source_stride; dst_ptr += dst_stride; } + + m_stats.num_vram_reads++; } void GPU_HW_OpenGL::FillVRAM(u32 x, u32 y, u32 width, u32 height, u16 color) @@ -583,6 +597,8 @@ void GPU_HW_OpenGL::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* scaled_flipped_y + scaled_height, GL_COLOR_BUFFER_BIT, GL_NEAREST); glEnable(GL_SCISSOR_TEST); } + + m_stats.num_vram_writes++; } void GPU_HW_OpenGL::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 height) diff --git a/src/core/gpu_hw_opengl.h b/src/core/gpu_hw_opengl.h index 0f9991270..525ed8297 100644 --- a/src/core/gpu_hw_opengl.h +++ b/src/core/gpu_hw_opengl.h @@ -35,9 +35,11 @@ protected: private: struct GLStats { - u32 num_vram_read_texture_updates; u32 num_batches; u32 num_vertices; + u32 num_vram_reads; + u32 num_vram_writes; + u32 num_vram_read_texture_updates; }; void DrawRendererStatistics();