diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-10 11:59:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-10 15:44:04 +0300 |
commit | c3d393c1df0c0fc33734ae518127f3188251e962 (patch) | |
tree | eb1e0333858c2036e41376ea67fc312b58ab4b6e /intern/cycles/kernel | |
parent | 73a9ff0d2d4f3cabcaa64f8e47586a793daa77f0 (diff) |
Cycles: Cleanup, indentation and trailing whitespace
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cpu.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index cad5f4d2959..459f1a28f63 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -353,7 +353,7 @@ template<typename T> struct texture_image { { int ix, iy, iz; int nix, niy, niz; - + float tx = frac(x*(float)width - 0.5f, &ix); float ty = frac(y*(float)height - 0.5f, &iy); float tz = frac(z*(float)depth - 0.5f, &iz); @@ -463,13 +463,13 @@ template<typename T> struct texture_image { const int xc[4] = {pix, ix, nix, nnix}; const int yc[4] = {width * piy, - width * iy, - width * niy, - width * nniy}; + width * iy, + width * niy, + width * nniy}; const int zc[4] = {width * height * piz, - width * height * iz, - width * height * niz, - width * height * nniz}; + width * height * iz, + width * height * niz, + width * height * nniz}; float u[4], v[4], w[4]; /* Some helper macro to keep code reasonable size, @@ -478,14 +478,14 @@ template<typename T> struct texture_image { #define DATA(x, y, z) (read(data[xc[x] + yc[y] + zc[z]])) #define COL_TERM(col, row) \ (v[col] * (u[0] * DATA(0, col, row) + \ - u[1] * DATA(1, col, row) + \ - u[2] * DATA(2, col, row) + \ - u[3] * DATA(3, col, row))) + u[1] * DATA(1, col, row) + \ + u[2] * DATA(2, col, row) + \ + u[3] * DATA(3, col, row))) #define ROW_TERM(row) \ (w[row] * (COL_TERM(0, row) + \ - COL_TERM(1, row) + \ - COL_TERM(2, row) + \ - COL_TERM(3, row))) + COL_TERM(1, row) + \ + COL_TERM(2, row) + \ + COL_TERM(3, row))) SET_CUBIC_SPLINE_WEIGHTS(u, tx); SET_CUBIC_SPLINE_WEIGHTS(v, ty); @@ -502,11 +502,10 @@ template<typename T> struct texture_image { ccl_always_inline float4 interp_3d_ex(float x, float y, float z, int interpolation = INTERPOLATION_LINEAR) { - if(UNLIKELY(!data)) return make_float4(0.0f, 0.0f, 0.0f, 0.0f); - switch(interpolation) { + switch(interpolation) { case INTERPOLATION_CLOSEST: return interp_3d_ex_closest(x, y, z); case INTERPOLATION_LINEAR: |