Subdiv: Reset evaluator creation statistics

Makes it more clear to see what was exactly happening at
the last invocation of subsurf modifier.
This commit is contained in:
2019-01-16 10:15:25 +01:00
parent 4fe6a2d950
commit 7eda267df1
3 changed files with 10 additions and 4 deletions

View File

@@ -188,6 +188,8 @@ void BKE_subdiv_stats_init(SubdivStats *stats);
void BKE_subdiv_stats_begin(SubdivStats *stats, eSubdivStatsValue value);
void BKE_subdiv_stats_end(SubdivStats *stats, eSubdivStatsValue value);
void BKE_subdiv_stats_reset(SubdivStats *stats, eSubdivStatsValue value);
void BKE_subdiv_stats_print(const SubdivStats *stats);
/* ================================ SETTINGS ================================ */

View File

@@ -46,10 +46,10 @@
bool BKE_subdiv_eval_begin(Subdiv *subdiv)
{
BKE_subdiv_stats_reset(&subdiv->stats, SUBDIV_STATS_EVALUATOR_CREATE);
if (subdiv->topology_refiner == NULL) {
/* Happens on input mesh with just loose geometry,
* or when OpenSubdiv is disabled
*/
* or when OpenSubdiv is disabled */
return false;
}
else if (subdiv->evaluator == NULL) {
@@ -76,8 +76,7 @@ static void set_coarse_positions(Subdiv *subdiv, const Mesh *mesh)
/* Mark vertices which needs new coordinates. */
/* TODO(sergey): This is annoying to calculate this on every update,
* maybe it's better to cache this mapping. Or make it possible to have
* OpenSubdiv's vertices match mesh ones?
*/
* OpenSubdiv's vertices match mesh ones? */
BLI_bitmap *vertex_used_map =
BLI_BITMAP_NEW(mesh->totvert, "vert used map");
for (int poly_index = 0; poly_index < mesh->totpoly; poly_index++) {

View File

@@ -56,6 +56,11 @@ void BKE_subdiv_stats_end(SubdivStats *stats, eSubdivStatsValue value)
PIL_check_seconds_timer() - stats->begin_timestamp_[value];
}
void BKE_subdiv_stats_reset(SubdivStats *stats, eSubdivStatsValue value)
{
stats->values_[value] = 0.0;
}
void BKE_subdiv_stats_print(const SubdivStats *stats)
{
#define STATS_PRINT_TIME(stats, value, description) \