Using "static const float ..." or "static const VectorRegister ..." in functions creates the branch and code to construct those constants. 更多...
Using "static const float ..." or "static const VectorRegister ..." in functions creates the branch and code to construct those constants.
Doing this in FORCEINLINE not only means you introduce a branch per static, but you bloat the inlined code immensely. Defining these constants at the global scope causes them to be created at startup, and avoids the cost at the function level. Doing it at the function level is okay for anything that is a simple "const float", but usage of "sqrt()" here forces actual function calls.