Blender Git Commit Log

Git Commits -> Revision 5c6baf1

Revision 5c6baf1 by Mike Erwin (master)
September 25, 2016, 12:27 (GMT)
specialize mat4 multiply routines

mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R.

This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM.

With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.

Commit Details:

Full Hash: 5c6baf1ee9754e39392926cd077bb2097baf39b9
Parent Commit: addc666
Lines Changed: +48, -23

2 Modified Paths:

/source/blender/blenlib/BLI_math_matrix.h (+5, -0) (Diff)
/source/blender/blenlib/intern/math_matrix.c (+43, -23) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021