diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-16 12:15:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-16 13:00:43 +0300 |
commit | 7eda267df1a997c1525a0aa62ad2de2f1b77c6e5 (patch) | |
tree | 4586acf09d50d17f7161fa929149ce8768c978a4 /source/blender/blenkernel/intern | |
parent | 4fe6a2d9501415d98f3c6a995526a8802920eedd (diff) |
Subdiv: Reset evaluator creation statistics
Makes it more clear to see what was exactly happening at
the last invocation of subsurf modifier.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_eval.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_stats.c | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_eval.c b/source/blender/blenkernel/intern/subdiv_eval.c index 7043edc7fc9..acc121a55fa 100644 --- a/source/blender/blenkernel/intern/subdiv_eval.c +++ b/source/blender/blenkernel/intern/subdiv_eval.c @@ -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++) { diff --git a/source/blender/blenkernel/intern/subdiv_stats.c b/source/blender/blenkernel/intern/subdiv_stats.c index 370aedad04f..dea536459b4 100644 --- a/source/blender/blenkernel/intern/subdiv_stats.c +++ b/source/blender/blenkernel/intern/subdiv_stats.c @@ -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) \ |