diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 14:51:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 15:14:24 +0300 |
commit | 3fba620858fa5bf44bec3124c61f6cc2e40356b0 (patch) | |
tree | 41aaddb8ad9fdd6b964a62b85129a703d626d5f8 /intern/cycles/kernel | |
parent | 29ebb56f4d8b99ca3038c7a3d0ed794ef77ee7f9 (diff) |
Cycles: Prepare for more image extension types support
Basically just replace boolean periodic flag with extension type enum in the
device API.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_compat_cpu.h | 14 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/kernel.cpp | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/intern/cycles/kernel/kernel.h b/intern/cycles/kernel/kernel.h index 5c34ddcfbcb..b2596d10ee7 100644 --- a/intern/cycles/kernel/kernel.h +++ b/intern/cycles/kernel/kernel.h @@ -39,7 +39,7 @@ void kernel_tex_copy(KernelGlobals *kg, size_t height, size_t depth, InterpolationType interpolation=INTERPOLATION_LINEAR, - bool periodic = true); + ExtensionType extension = EXTENSION_REPEAT); void kernel_cpu_path_trace(KernelGlobals *kg, float *buffer, unsigned int *rng_state, int sample, int x, int y, int offset, int stride); diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index a780c356a18..be8e54b3d3d 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -138,7 +138,7 @@ template<typename T> struct texture_image { if(interpolation == INTERPOLATION_CLOSEST) { frac(x*(float)width, &ix); frac(y*(float)height, &iy); - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); @@ -153,7 +153,7 @@ template<typename T> struct texture_image { float tx = frac(x*(float)width - 0.5f, &ix); float ty = frac(y*(float)height - 0.5f, &iy); - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); @@ -180,7 +180,7 @@ template<typename T> struct texture_image { const float tx = frac(x*(float)width - 0.5f, &ix); const float ty = frac(y*(float)height - 0.5f, &iy); int pix, piy, nnix, nniy; - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); @@ -251,7 +251,7 @@ template<typename T> struct texture_image { frac(y*(float)height, &iy); frac(z*(float)depth, &iz); - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); @@ -269,7 +269,7 @@ template<typename T> struct texture_image { float ty = frac(y*(float)height - 0.5f, &iy); float tz = frac(z*(float)depth - 0.5f, &iz); - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); @@ -309,7 +309,7 @@ template<typename T> struct texture_image { const float tz = frac(z*(float)depth - 0.5f, &iz); int pix, piy, piz, nnix, nniy, nniz; - if(periodic) { + if(extension == EXTENSION_REPEAT) { ix = wrap_periodic(ix, width); iy = wrap_periodic(iy, height); iz = wrap_periodic(iz, depth); @@ -392,7 +392,7 @@ template<typename T> struct texture_image { T *data; int interpolation; - bool periodic; + ExtensionType extension; int width, height, depth; #undef SET_CUBIC_SPLINE_WEIGHTS }; diff --git a/intern/cycles/kernel/kernels/cpu/kernel.cpp b/intern/cycles/kernel/kernels/cpu/kernel.cpp index 2dbd9e62ee7..2c8d3503c1a 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel.cpp @@ -45,7 +45,7 @@ void kernel_tex_copy(KernelGlobals *kg, size_t height, size_t depth, InterpolationType interpolation, - bool periodic) + ExtensionType extension) { if(0) { } @@ -71,7 +71,7 @@ void kernel_tex_copy(KernelGlobals *kg, tex->data = (float4*)mem; tex->dimensions_set(width, height, depth); tex->interpolation = interpolation; - tex->periodic = periodic; + tex->extension = extension; } } else if(strstr(name, "__tex_image")) { @@ -87,7 +87,7 @@ void kernel_tex_copy(KernelGlobals *kg, tex->data = (uchar4*)mem; tex->dimensions_set(width, height, depth); tex->interpolation = interpolation; - tex->periodic = periodic; + tex->extension = extension; } } else |