Make sure to update the _maxEdgeFaces in the child from the parent

level before we do any further population from the parent as that may
further modify the child's _maxEdgeFaces.  When _maxEdgeFaces is incorrect
we may end up with stack corruption problems when
Far::TopologyRefiner::interpolateChildVertsFromEdges() goes to use this data
to allocate some stack space.
This commit is contained in:
George ElKoura 2015-03-30 18:49:26 -07:00
parent da9c8a83dc
commit d38d683d0a
2 changed files with 10 additions and 4 deletions

View File

@ -373,6 +373,11 @@ QuadRefinement::populateEdgeFaceRelation() {
child._edgeFaceIndices.resize( childEdgeFaceIndexSizeEstimate);
child._edgeFaceLocalIndices.resize(childEdgeFaceIndexSizeEstimate);
// Update _maxEdgeFaces from the parent level before calling the
// populateEdgeFacesFromParent methods below, as these may further
// update _maxEdgeFaces.
child._maxEdgeFaces = parent._maxEdgeFaces;
populateEdgeFacesFromParentFaces();
populateEdgeFacesFromParentEdges();
@ -382,8 +387,6 @@ QuadRefinement::populateEdgeFaceRelation() {
child.getOffsetOfEdgeFaces(child.getNumEdges()-1);
child._edgeFaceIndices.resize( childEdgeFaceIndexSizeEstimate);
child._edgeFaceLocalIndices.resize(childEdgeFaceIndexSizeEstimate);
child._maxEdgeFaces = parent._maxEdgeFaces;
}
void

View File

@ -366,6 +366,11 @@ TriRefinement::populateEdgeFaceRelation() {
_child->_edgeFaceIndices.resize(childEdgeFaceIndexSizeEstimate);
_child->_edgeFaceLocalIndices.resize(childEdgeFaceIndexSizeEstimate);
// Update _maxEdgeFaces from the parent level before calling the
// populateEdgeFacesFromParent methods below, as these may further
// update _maxEdgeFaces.
_child->_maxEdgeFaces = _parent->_maxEdgeFaces;
populateEdgeFacesFromParentFaces();
populateEdgeFacesFromParentEdges();
@ -375,8 +380,6 @@ TriRefinement::populateEdgeFaceRelation() {
_child->getOffsetOfEdgeFaces(_child->getNumEdges()-1);
_child->_edgeFaceIndices.resize(childEdgeFaceIndexSizeEstimate);
_child->_edgeFaceLocalIndices.resize(childEdgeFaceIndexSizeEstimate);
_child->_maxEdgeFaces = _parent->_maxEdgeFaces;
}
void