GS: Add stat for barriers

This commit is contained in:
Connor McLaughlin 2022-03-28 21:49:39 +10:00 committed by refractionpcsx2
parent de724d9570
commit 1c50d3e4b3
4 changed files with 12 additions and 2 deletions

View File

@ -727,23 +727,25 @@ void GSgetStats(std::string& info)
{
if (GSConfig.TexturePreloading == TexturePreloadingLevel::Full)
{
info = format("%s HW | HC: %d MB | %d P | %d D | %d DC | %d RB | %d TC | %d TU",
info = format("%s HW | HC: %d MB | %d P | %d D | %d DC | %d B | %d RB | %d TC | %d TU",
api_name,
(int)std::ceil(static_cast<GSRendererHW*>(s_gs.get())->GetTextureCache()->GetHashCacheMemoryUsage() / 1048576.0f),
(int)pm.Get(GSPerfMon::Prim),
(int)pm.Get(GSPerfMon::Draw),
(int)std::ceil(pm.Get(GSPerfMon::DrawCalls)),
(int)std::ceil(pm.Get(GSPerfMon::Barriers)),
(int)std::ceil(pm.Get(GSPerfMon::Readbacks)),
(int)std::ceil(pm.Get(GSPerfMon::TextureCopies)),
(int)std::ceil(pm.Get(GSPerfMon::TextureUploads)));
}
else
{
info = format("%s HW | %d P | %d D | %d DC | %d RB | %d TC | %d TU",
info = format("%s HW | %d P | %d D | %d DC | %d B | %d RB | %d TC | %d TU",
api_name,
(int)pm.Get(GSPerfMon::Prim),
(int)pm.Get(GSPerfMon::Draw),
(int)std::ceil(pm.Get(GSPerfMon::DrawCalls)),
(int)std::ceil(pm.Get(GSPerfMon::Barriers)),
(int)std::ceil(pm.Get(GSPerfMon::Readbacks)),
(int)std::ceil(pm.Get(GSPerfMon::TextureCopies)),
(int)std::ceil(pm.Get(GSPerfMon::TextureUploads)));

View File

@ -29,6 +29,7 @@ public:
Fillrate,
Quad,
SyncPoint,
Barriers,
CounterLast,
// Reused counters for HW.

View File

@ -2045,6 +2045,8 @@ void GSDeviceOGL::SendHWDraw(const GSHWDrawConfig& config, bool needs_barrier)
config.nindices / config.indices_per_prim, config.drawlist->size(), message.c_str());
#endif
g_perfmon.Put(GSPerfMon::Barriers, static_cast<u32>(config.drawlist->size()));
for (size_t count = 0, p = 0, n = 0; n < config.drawlist->size(); p += count, ++n)
{
count = (*config.drawlist)[n] * config.indices_per_prim;
@ -2063,6 +2065,7 @@ void GSDeviceOGL::SendHWDraw(const GSHWDrawConfig& config, bool needs_barrier)
GL_PUSH("Split the draw");
GL_PERF("Split single draw in %d draw", config.nindices / config.indices_per_prim);
g_perfmon.Put(GSPerfMon::Barriers, config.nindices / config.indices_per_prim);
for (size_t p = 0; p < config.nindices; p += config.indices_per_prim)
{
@ -2077,6 +2080,7 @@ void GSDeviceOGL::SendHWDraw(const GSHWDrawConfig& config, bool needs_barrier)
{
// The common renderer code doesn't put a barrier here because D3D/VK need to copy the DS, so we need to check it.
// One barrier needed for non-overlapping draw.
g_perfmon.Put(GSPerfMon::Barriers, 1);
glTextureBarrier();
DrawIndexedPrimitive();
return;

View File

@ -3145,6 +3145,7 @@ void GSDeviceVK::SendHWDraw(const GSHWDrawConfig& config, GSTextureVK* draw_rt)
if (config.drawlist)
{
GL_PUSH("Split the draw (SPRITE)");
g_perfmon.Put(GSPerfMon::Barriers, static_cast<u32>(config.drawlist->size()));
for (u32 count = 0, p = 0, n = 0; n < static_cast<u32>(config.drawlist->size()); p += count, ++n)
{
@ -3161,6 +3162,7 @@ void GSDeviceVK::SendHWDraw(const GSHWDrawConfig& config, GSTextureVK* draw_rt)
if (config.require_full_barrier)
{
GL_PUSH("Split single draw in %d draw", config.nindices / config.indices_per_prim);
g_perfmon.Put(GSPerfMon::Barriers, config.nindices / config.indices_per_prim);
for (u32 p = 0; p < config.nindices; p += config.indices_per_prim)
{
@ -3173,6 +3175,7 @@ void GSDeviceVK::SendHWDraw(const GSHWDrawConfig& config, GSTextureVK* draw_rt)
if (config.require_one_barrier)
{
g_perfmon.Put(GSPerfMon::Barriers, 1);
ColorBufferBarrier(draw_rt);
DrawIndexedPrimitive();
return;