| 663 | } |
| 664 | |
| 665 | void GSgetStats(SmallStringBase& info) |
| 666 | { |
| 667 | GSPerfMon& pm = g_perfmon; |
| 668 | const char* api_name = GSDevice::RenderAPIToString(g_gs_device->GetRenderAPI()); |
| 669 | if (GSCurrentRenderer == GSRendererType::SW) |
| 670 | { |
| 671 | const double fps = GetVerticalFrequency(); |
| 672 | const double fillrate = pm.Get(GSPerfMon::Fillrate); |
| 673 | double pps = fps * fillrate; |
| 674 | char prefix = '\0'; |
| 675 | |
| 676 | if (pps >= 170000000) |
| 677 | { |
| 678 | pps /= _1gb; // Gpps |
| 679 | prefix = 'G'; |
| 680 | } |
| 681 | else if (pps >= 35000000) |
| 682 | { |
| 683 | pps /= _1mb; // Mpps |
| 684 | prefix = 'M'; |
| 685 | } |
| 686 | else if (pps >= _1kb) |
| 687 | { |
| 688 | pps /= _1kb; // kpps |
| 689 | prefix = 'k'; |
| 690 | } |
| 691 | |
| 692 | info.format("{} SW | {} SYNP | {} PRIM | {} DRW | {:.2f} SWIZ | {:.2f} UNSWIZ | {:.2f} {}pps", |
| 693 | api_name, |
| 694 | (int)pm.Get(GSPerfMon::SyncPoint), |
| 695 | (int)pm.Get(GSPerfMon::Prim), |
| 696 | (int)pm.Get(GSPerfMon::Draw), |
| 697 | pm.Get(GSPerfMon::Swizzle) / _1kb, |
| 698 | pm.Get(GSPerfMon::Unswizzle) / _1kb, |
| 699 | pps, prefix); |
| 700 | } |
| 701 | else if (GSCurrentRenderer == GSRendererType::Null) |
| 702 | { |
| 703 | info.format("{} Null", api_name); |
| 704 | } |
| 705 | else |
| 706 | { |
| 707 | if (!GSConfig.HWROV) |
| 708 | { |
| 709 | info.format("{} HW | {} PRIM | {} DRW | {} DRWC | {} BAR | {} RP | {} RB | {} TC | {} TU", |
| 710 | api_name, |
| 711 | (int)pm.Get(GSPerfMon::Prim), |
| 712 | (int)pm.Get(GSPerfMon::Draw), |
| 713 | (int)std::ceil(pm.Get(GSPerfMon::DrawCalls)), |
| 714 | (int)std::ceil(pm.Get(GSPerfMon::Barriers)), |
| 715 | (int)std::ceil(pm.Get(GSPerfMon::RenderPasses)), |
| 716 | (int)std::ceil(pm.Get(GSPerfMon::Readbacks)), |
| 717 | (int)std::ceil(pm.Get(GSPerfMon::TextureCopies)), |
| 718 | (int)std::ceil(pm.Get(GSPerfMon::TextureUploads))); |
| 719 | } |
| 720 | else |
| 721 | { |
| 722 | // Add ROV stats along standard stats. |
no test coverage detected