diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-25 11:04:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-25 11:04:25 +0300 |
commit | ef22d2e8adb9965cd3cb91e733d4b9754cf6024f (patch) | |
tree | 1d95a52cd619be4b9974c6aa2f197373a1831912 /intern/cycles/util | |
parent | 2a6e4f71576ebee19f34fd5f7c214fd2e9f060f8 (diff) | |
parent | d02335a1950c81fffea815f31e47bca92ab7d33c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_math_matrix.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_matrix.h b/intern/cycles/util/util_math_matrix.h index 382dad64ea5..9ffcb9659b2 100644 --- a/intern/cycles/util/util_math_matrix.h +++ b/intern/cycles/util/util_math_matrix.h @@ -144,6 +144,18 @@ ccl_device_inline void math_trimatrix_add_gramian_strided(ccl_global float *A, } } +ccl_device_inline void math_trimatrix_add_gramian(ccl_global float *A, + int n, + const float *ccl_restrict v, + float weight) +{ + for(int row = 0; row < n; row++) { + for(int col = 0; col <= row; col++) { + MATHS(A, row, col, 1) += v[row]*v[col]*weight; + } + } +} + /* Transpose matrix A inplace. */ ccl_device_inline void math_matrix_transpose(ccl_global float *A, int n, int stride) { |