vk: profiler: clear metrics explicitly

This commit is contained in:
Ivan Avdeev 2023-03-25 12:01:04 -07:00 committed by Ivan Avdeev
parent 1ae3ae4774
commit 8afd23a2d4
1 changed files with 8 additions and 0 deletions

View File

@ -296,6 +296,12 @@ static void printMetrics( void ) {
speedsPrintf("%s: %.03fms\n", metric->name, *metric->p_value * 1e-3f);
break;
}
}
}
static void clearMetrics( void ) {
for (int i = 0; i < g_speeds.metrics_count; ++i) {
const r_speeds_metric_t *const metric = g_speeds.metrics + i;
*metric->p_value = 0;
}
}
@ -358,6 +364,8 @@ void R_ShowExtendedProfilingData(uint32_t prev_frame_index, uint64_t gpu_frame_b
printMetrics();
}
clearMetrics();
APROF_SCOPE_END(function);
}