diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2016-10-30 01:56:39 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2016-10-30 13:51:20 +0300 |
commit | 4e68f48227e228fbf75736005ceed4cf1cb55215 (patch) | |
tree | 5bc3cf3e92d1b63714055cabd3d73eb971d1bcaa /intern/cycles/util | |
parent | 26bf230920cb9ca0aa9626430169967f9e120482 (diff) |
Cycles: Initialize the RNG state from the kernel instead of the host
This allows to save a memory copy, which will be particularly useful for network rendering.
Reviewers: sergey, brecht, dingto, juicyfruit, maiself
Differential Revision: https://developer.blender.org/D2323
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_hash.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/util/util_hash.h b/intern/cycles/util/util_hash.h index 3ff2802b46d..98c3a681ff2 100644 --- a/intern/cycles/util/util_hash.h +++ b/intern/cycles/util/util_hash.h @@ -21,7 +21,7 @@ CCL_NAMESPACE_BEGIN -static inline uint hash_int_2d(uint kx, uint ky) +ccl_device_inline uint hash_int_2d(uint kx, uint ky) { #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) @@ -44,11 +44,12 @@ static inline uint hash_int_2d(uint kx, uint ky) #undef rot } -static inline uint hash_int(uint k) +ccl_device_inline uint hash_int(uint k) { return hash_int_2d(k, 0); } +#ifndef __KERNEL_GPU__ static inline uint hash_string(const char *str) { uint i = 0, c; @@ -58,6 +59,7 @@ static inline uint hash_string(const char *str) return i; } +#endif CCL_NAMESPACE_END |