diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-05-15 17:12:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-05-15 17:14:18 +0300 |
commit | e053fade993204bbfaa98ced1b056e02226a3e61 (patch) | |
tree | 3990b649fe9a0b3d73ded25f9fab47b1aeca4790 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | ae9da3786a3ea2e62b1ece7e28628c2dbadf0605 (diff) |
Mesh Batch Cache: get rid of the ORCO VBO data, and reconstruct it in shader.
With only one MADD instruction we recover the orco data and reduce both the storage and the fetching cost of an attrib layer.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 75bbfda3f5b..4f658ef015f 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -658,6 +658,14 @@ MINLINE void invert_v2(float r[2]) r[1] = 1.0f / r[1]; } +MINLINE void invert_v3(float r[3]) +{ + BLI_assert(!ELEM(0.0f, r[0], r[1], r[2])); + r[0] = 1.0f / r[0]; + r[1] = 1.0f / r[1]; + r[2] = 1.0f / r[2]; +} + MINLINE void abs_v2(float r[2]) { r[0] = fabsf(r[0]); |