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:
@@ -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 ================================ */
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user