Cycles: Avoid crash in statistics when canceling BVH build

Also add missing render_time initialization in progress.
This commit is contained in:
Sergey Sharybin 2015-01-19 13:39:35 +05:00
parent 32ffc63d20
commit 2f4aef9f3b
2 changed files with 10 additions and 8 deletions

View File

@ -268,21 +268,22 @@ BVHNode* BVHBuild::run()
if(progress.get_cancel()) {
rootnode->deleteSubtree();
rootnode = NULL;
VLOG(1) << "BVH build cancelled.";
}
else if(!params.use_spatial_split) {
/*rotate(rootnode, 4, 5);*/
rootnode->update_visibility();
VLOG(1) << "BVH build statistics:\n"
<< " Build time: " << time_dt() - build_start_time << "\n"
<< " Total number of nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT) << "\n"
<< " Number of inner nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_INNER_COUNT) << "\n"
<< " Number of leaf nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_LEAF_COUNT) << "\n";
}
}
VLOG(1) << "BVH build statistics:\n"
<< " Build time: " << time_dt() - build_start_time << "\n"
<< " Total number of nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT) << "\n"
<< " Number of inner nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_INNER_COUNT) << "\n"
<< " Number of leaf nodes: "
<< rootnode->getSubtreeSize(BVH_STAT_LEAF_COUNT) << "\n";
return rootnode;
}

View File

@ -38,6 +38,7 @@ public:
sample = 0;
start_time = time_dt();
total_time = 0.0f;
render_time = 0.0f;
tile_time = 0.0f;
status = "Initializing";
substatus = "";