diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-07 21:32:01 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-07 21:32:01 +0400 |
commit | 4a427a441b37ad0539e3c758b31a384edf8b7c76 (patch) | |
tree | b8b4a69ec083d547068f2a30b76e13100f813e90 /intern/cycles/kernel/svm/svm_noise.h | |
parent | b67b1c8564cedfc425892f6b071210b724366523 (diff) |
Fix #30049: cycles noise texture producing nan values with some
texture coordinates, due to int overflow.
Also minor tweak in shader code to avoid copying uninitialized
values, should have no effect though because they were not used.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_noise.h')
-rw-r--r-- | intern/cycles/kernel/svm/svm_noise.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/kernel/svm/svm_noise.h b/intern/cycles/kernel/svm/svm_noise.h index 28ad028ad0e..1d3ace061ab 100644 --- a/intern/cycles/kernel/svm/svm_noise.h +++ b/intern/cycles/kernel/svm/svm_noise.h @@ -84,8 +84,9 @@ __device uint phash(int kx, int ky, int kz, int3 p) __device float floorfrac(float x, int* i) { - *i = quick_floor(x); - return x - *i; + float f = floorf(x); + *i = (int)f; + return x - f; } __device float fade(float t) |