From c3d393c1df0c0fc33734ae518127f3188251e962 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 10 Apr 2017 10:59:31 +0200 Subject: Cycles: Cleanup, indentation and trailing whitespace --- intern/cycles/kernel/kernel_compat_cpu.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'intern/cycles/kernel/kernel_compat_cpu.h') 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 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 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 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 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: -- cgit v1.2.3