[Bf-blender-cvs] [aff5e18adb8] master: Cleanup: replace inline dot-product with dot_v4v4

Campbell Barton noreply at git.blender.org
Fri May 1 09:57:56 CEST 2020


Commit: aff5e18adb8f1a22fcf56b49c4539341ef197da9
Author: Campbell Barton
Date:   Fri May 1 15:04:05 2020 +1000
Branches: master
https://developer.blender.org/rBaff5e18adb8f1a22fcf56b49c4539341ef197da9

Cleanup: replace inline dot-product with dot_v4v4

===================================================================

M	source/blender/render/intern/source/render_texture.c

===================================================================

diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index de317d55370..ee484924bf9 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -761,8 +761,7 @@ static int voronoiTex(const Tex *tex, const float texvec[3], TexResult *texres)
   }
 
   voronoi(texvec[0], texvec[1], texvec[2], da, pa, tex->vn_mexp, tex->vn_distm);
-  texres->tin = sc * fabsf(tex->vn_w1 * da[0] + tex->vn_w2 * da[1] + tex->vn_w3 * da[2] +
-                           tex->vn_w4 * da[3]);
+  texres->tin = sc * fabsf(dot_v4v4(&tex->vn_w1, da));
 
   if (tex->vn_coltype) {
     float ca[3]; /* cell color */
@@ -809,14 +808,11 @@ static int voronoiTex(const Tex *tex, const float texvec[3], TexResult *texres)
 
     /* calculate bumpnormal */
     voronoi(texvec[0] + offs, texvec[1], texvec[2], da, pa, tex->vn_mexp, tex->vn_distm);
-    texres->nor[0] = sc * fabsf(tex->vn_w1 * da[0] + tex->vn_w2 * da[1] + tex->vn_w3 * da[2] +
-                                tex->vn_w4 * da[3]);
+    texres->nor[0] = sc * fabsf(dot_v4v4(&tex->vn_w1, da));
     voronoi(texvec[0], texvec[1] + offs, texvec[2], da, pa, tex->vn_mexp, tex->vn_distm);
-    texres->nor[1] = sc * fabsf(tex->vn_w1 * da[0] + tex->vn_w2 * da[1] + tex->vn_w3 * da[2] +
-                                tex->vn_w4 * da[3]);
+    texres->nor[1] = sc * fabsf(dot_v4v4(&tex->vn_w1, da));
     voronoi(texvec[0], texvec[1], texvec[2] + offs, da, pa, tex->vn_mexp, tex->vn_distm);
-    texres->nor[2] = sc * fabsf(tex->vn_w1 * da[0] + tex->vn_w2 * da[1] + tex->vn_w3 * da[2] +
-                                tex->vn_w4 * da[3]);
+    texres->nor[2] = sc * fabsf(dot_v4v4(&tex->vn_w1, da));
 
     tex_normal_derivate(tex, texres);
     rv |= TEX_NOR;



More information about the Bf-blender-cvs mailing list