diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-05-18 15:13:03 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-05-18 15:35:08 -0400 |
| commit | c58b5e9b9bccf9baac5d5fb5aa6e254528f19782 (patch) | |
| tree | f1934294892823acb55cf97461831b2682dc7fc3 /Source/Core/VideoBackends/Software/EfbInterface.cpp | |
| parent | f3a8874214b61f33332b826a37ac9ca25dee1477 (diff) | |
EfbInterface: Make perf_values internally linked
Instead, expose functions to operate with it. This way we keep the
internal representation concealed.
Diffstat (limited to 'Source/Core/VideoBackends/Software/EfbInterface.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/EfbInterface.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index cf30c35a48..1d5dab1f49 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -22,7 +22,7 @@ namespace EfbInterface { static u8 efb[EFB_WIDTH * EFB_HEIGHT * 6]; -u32 perf_values[PQ_NUM_MEMBERS]; +static u32 perf_values[PQ_NUM_MEMBERS]; static inline u32 GetColorOffset(u16 x, u16 y) { @@ -682,4 +682,27 @@ bool ZCompare(u16 x, u16 y, u32 z) return pass; } + +u32 GetPerfQueryResult(PerfQueryType type) +{ + return perf_values[type]; +} + +void ResetPerfQuery() +{ + std::memset(perf_values, 0, sizeof(perf_values)); +} + +void IncPerfCounterQuadCount(PerfQueryType type) +{ + // NOTE: hardware doesn't process individual pixels but quads instead. + // Current software renderer architecture works on pixels though, so + // we have this "quad" hack here to only increment the registers on + // every fourth rendered pixel + static u32 quad[PQ_NUM_MEMBERS]; + if (++quad[type] != 3) + return; + quad[type] = 0; + ++perf_values[type]; +} } |
