Added btSoftBodyHelpers::ReoptimizeLinkOrder(btSoftBody* softBody) method, to help improve performance for modern out-of-core CPUs.

It is tested in Aero2 demo (13) of AppSoftBodyDemo. Note that the cloth in Areo2 is not expensive enough to see benefits. Increase segments to see benefits.
Thanks a lot for the contribution.
This commit is contained in:
erwincoumans
2014-04-08 09:45:09 -07:00
parent 84693c2384
commit aa76b88936
4 changed files with 177 additions and 3 deletions

View File

@@ -137,7 +137,12 @@ struct btSoftBodyHelpers
bool bfacelinks,
bool btetralinks,
bool bfacesfromtetras);
/// Sort the list of links to move link calculations that are dependent upon earlier
/// ones as far as possible away from the calculation of those values
/// This tends to make adjacent loop iterations not dependent upon one another,
/// so out-of-order processors can execute instructions from multiple iterations at once
static void ReoptimizeLinkOrder(btSoftBody *psb );
};
#endif //BT_SOFT_BODY_HELPERS_H