mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-29 19:15:38 +00:00
GPU: Add VRAM read/write stats to GL renderer
This commit is contained in:
parent
1c79737021
commit
1d1da1d82c
|
@ -78,7 +78,7 @@ void GPU_HW_OpenGL::DrawRendererStatsWindow()
|
||||||
{
|
{
|
||||||
GPU_HW::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;
|
const bool is_null_frame = m_stats.num_batches == 0;
|
||||||
if (!is_null_frame)
|
if (!is_null_frame)
|
||||||
|
@ -92,6 +92,21 @@ void GPU_HW_OpenGL::DrawRendererStatsWindow()
|
||||||
ImGui::Columns(2);
|
ImGui::Columns(2);
|
||||||
ImGui::SetColumnWidth(0, 200.0f);
|
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::TextUnformatted("VRAM Read Texture Updates:");
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
ImGui::Text("%u", m_last_stats.num_vram_read_texture_updates);
|
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::Text("%u", m_last_stats.num_vertices);
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
|
||||||
ImGui::TextUnformatted("GPU Active In This Frame: ");
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::Text("%s", is_null_frame ? "Yes" : "No");
|
|
||||||
ImGui::NextColumn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::End();
|
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;
|
source_ptr -= source_stride;
|
||||||
dst_ptr += dst_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)
|
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);
|
scaled_flipped_y + scaled_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
glEnable(GL_SCISSOR_TEST);
|
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)
|
void GPU_HW_OpenGL::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 height)
|
||||||
|
|
|
@ -35,9 +35,11 @@ protected:
|
||||||
private:
|
private:
|
||||||
struct GLStats
|
struct GLStats
|
||||||
{
|
{
|
||||||
u32 num_vram_read_texture_updates;
|
|
||||||
u32 num_batches;
|
u32 num_batches;
|
||||||
u32 num_vertices;
|
u32 num_vertices;
|
||||||
|
u32 num_vram_reads;
|
||||||
|
u32 num_vram_writes;
|
||||||
|
u32 num_vram_read_texture_updates;
|
||||||
};
|
};
|
||||||
|
|
||||||
void DrawRendererStatistics();
|
void DrawRendererStatistics();
|
||||||
|
|
Loading…
Reference in a new issue