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>2016-04-15 16:29:12 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-04-15 16:30:30 +0300
commit3165e8740b83f28569a9e405757f4c34c378df3b (patch)
tree35cf95b439c7b7f1b63380659b9971ea4868a017 /intern/cycles/util/util_math.h
parent177d051126b3ea4a1dec6a016ae67d7f51f233d0 (diff)
Fix T48139: Checker texture strange behavior in cycles
Seems particular CUDA implementations has some precision issues, which made integer coordinate (which was expected to always be positive) to go negative.
Diffstat (limited to 'intern/cycles/util/util_math.h')
-rw-r--r--intern/cycles/util/util_math.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index cdbc37fd32c..32924f9a8c2 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -97,6 +97,11 @@ ccl_device_inline float fminf(float a, float b)
#ifndef __KERNEL_GPU__
+ccl_device_inline int abs(int x)
+{
+ return (x > 0)? x: -x;
+}
+
ccl_device_inline int max(int a, int b)
{
return (a > b)? a: b;