mirror of
https://github.com/simple64/simple64.git
synced 2026-09-07 04:42:43 +02:00
update parallel rdp
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2017-2020 Hans-Kristian Arntzen
|
||||
/* Copyright (c) 2017-2022 Hans-Kristian Arntzen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
@@ -455,6 +455,13 @@ const string &TimestampInterval::get_tag() const
|
||||
return tag;
|
||||
}
|
||||
|
||||
void TimestampInterval::reset()
|
||||
{
|
||||
total_time = 0.0;
|
||||
total_accumulations = 0;
|
||||
total_frame_iterations = 0;
|
||||
}
|
||||
|
||||
TimestampInterval::TimestampInterval(string tag_)
|
||||
: tag(move(tag_))
|
||||
{
|
||||
@@ -473,17 +480,35 @@ void TimestampIntervalManager::mark_end_of_frame_context()
|
||||
timestamp.mark_end_of_frame_context();
|
||||
}
|
||||
|
||||
void TimestampIntervalManager::log_simple()
|
||||
void TimestampIntervalManager::reset()
|
||||
{
|
||||
for (auto ×tamp : timestamps)
|
||||
timestamp.reset();
|
||||
}
|
||||
|
||||
void TimestampIntervalManager::log_simple(const TimestampIntervalReportCallback &func) const
|
||||
{
|
||||
for (auto ×tamp : timestamps)
|
||||
{
|
||||
LOGI("Timestamp tag report: %s\n", timestamp.get_tag().c_str());
|
||||
if (timestamp.get_total_frame_iterations())
|
||||
{
|
||||
LOGI(" %.3f ms / iteration\n", 1000.0 * timestamp.get_time_per_accumulation());
|
||||
LOGI(" %.3f ms / frame context\n", 1000.0 * timestamp.get_time_per_iteration());
|
||||
LOGI(" %.3f iterations / frame context\n",
|
||||
double(timestamp.get_total_accumulations()) / double(timestamp.get_total_frame_iterations()));
|
||||
TimestampIntervalReport report = {};
|
||||
report.time_per_accumulation = timestamp.get_time_per_accumulation();
|
||||
report.time_per_frame_context = timestamp.get_time_per_iteration();
|
||||
report.accumulations_per_frame_context =
|
||||
double(timestamp.get_total_accumulations()) / double(timestamp.get_total_frame_iterations());
|
||||
|
||||
if (func)
|
||||
{
|
||||
func(timestamp.get_tag(), report);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGI("Timestamp tag report: %s\n", timestamp.get_tag().c_str());
|
||||
LOGI(" %.3f ms / iteration\n", 1000.0 * report.time_per_accumulation);
|
||||
LOGI(" %.3f ms / frame context\n", 1000.0 * report.time_per_frame_context);
|
||||
LOGI(" %.3f iterations / frame context\n", report.accumulations_per_frame_context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user