Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-07-28 17:31:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-07-28 17:31:27 +0300
commita6b2650c7d94048591ab7c8b7b8fc4d533424bfb (patch)
tree98dbb7de80a85ccd04e4e632a601ebff44279674 /intern/cycles/kernel/kernel_compat_cpu.h
parent971affb4366634da35a7d9637243d451f0b227e2 (diff)
Cycles: Correction to image extension type commits
Clipping wasn't working totally correct, need to check original coordinates, not the integer ones, Now CPU gives the same exact results for both SVM and OSL, CUDA is still doing something crazy with edges.
Diffstat (limited to 'intern/cycles/kernel/kernel_compat_cpu.h')
-rw-r--r--intern/cycles/kernel/kernel_compat_cpu.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h
index 37387d7fa25..d02670f630a 100644
--- a/intern/cycles/kernel/kernel_compat_cpu.h
+++ b/intern/cycles/kernel/kernel_compat_cpu.h
@@ -144,7 +144,7 @@ template<typename T> struct texture_image {
iy = wrap_periodic(iy, height);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */
@@ -168,7 +168,7 @@ template<typename T> struct texture_image {
niy = wrap_periodic(iy+1, height);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */
@@ -208,7 +208,7 @@ template<typename T> struct texture_image {
nniy = wrap_periodic(iy+2, height);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */
@@ -279,7 +279,7 @@ template<typename T> struct texture_image {
iz = wrap_periodic(iz, depth);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */
@@ -308,7 +308,7 @@ template<typename T> struct texture_image {
niz = wrap_periodic(iz+1, depth);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */
@@ -363,7 +363,7 @@ template<typename T> struct texture_image {
nniz = wrap_periodic(iz+2, depth);
break;
case EXTENSION_CLIP:
- if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+ if (x < 0.0f || y < 0.0f || x >= width || y >= height) {
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
}
/* Fall through. */