2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 05:07:43 +00:00

Per-stage shader hashing

This commit is contained in:
Jack Andersen
2019-06-05 14:07:50 -10:00
parent 5e60131062
commit b7aa3e06d2
10 changed files with 134 additions and 48 deletions

View File

@@ -8,15 +8,18 @@ class CStopwatch {
public:
CStopwatch() : m_start(std::chrono::steady_clock::now()) {}
void report(const char* name) const {
printf("%s %f\n", name,
std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - m_start).count() /
1000000.f);
double report(const char* name) const {
double t = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - m_start).count() / 1000000.0;
printf("%s %f\n", name, t);
return t;
}
void reportReset(const char* name) {
double reportReset(const char* name) {
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
printf("%s %f\n", name, std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.f);
double t = std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.0;
printf("%s %f\n", name, t);
m_start = now;
return t;
}
};
} // namespace urde