diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-15 16:29:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-15 16:30:30 +0300 |
commit | 3165e8740b83f28569a9e405757f4c34c378df3b (patch) | |
tree | 35cf95b439c7b7f1b63380659b9971ea4868a017 /intern/cycles/kernel/svm | |
parent | 177d051126b3ea4a1dec6a016ae67d7f51f233d0 (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/kernel/svm')
-rw-r--r-- | intern/cycles/kernel/svm/svm_checker.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/kernel/svm/svm_checker.h b/intern/cycles/kernel/svm/svm_checker.h index 186bf7df55f..cea245991de 100644 --- a/intern/cycles/kernel/svm/svm_checker.h +++ b/intern/cycles/kernel/svm/svm_checker.h @@ -25,9 +25,9 @@ ccl_device_noinline float svm_checker(float3 p) p.y = (p.y + 0.000001f)*0.999999f; p.z = (p.z + 0.000001f)*0.999999f; - int xi = float_to_int(fabsf(floorf(p.x))); - int yi = float_to_int(fabsf(floorf(p.y))); - int zi = float_to_int(fabsf(floorf(p.z))); + int xi = abs(float_to_int(floorf(p.x))); + int yi = abs(float_to_int(floorf(p.y))); + int zi = abs(float_to_int(floorf(p.z))); return ((xi % 2 == yi % 2) == (zi % 2))? 1.0f: 0.0f; } |