diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-13 15:02:51 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-13 15:02:51 +0400 |
commit | 4061f96d94aa410dd8550bb6b3ed8f6f87beb5de (patch) | |
tree | 2d2cc9c48cc6eadd5c092b3024980f9d7d475337 /intern | |
parent | 35629a623ba1fb13db96209a206cc4aedbc9cf9e (diff) |
Fix cycles issue with BVH cache created with 64 bits and used for 32 bits binary,
and vice versa.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/bvh/bvh.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/util/util_cache.h | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 500b07f755b..f11b3c4c0bc 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -30,6 +30,7 @@ #include "util_foreach.h" #include "util_map.h" #include "util_progress.h" +#include "util_system.h" #include "util_types.h" CCL_NAMESPACE_BEGIN @@ -71,6 +72,7 @@ BVH *BVH::create(const BVHParams& params, const vector<Object*>& objects) bool BVH::cache_read(CacheData& key) { + key.add(system_cpu_bits()); key.add(¶ms, sizeof(params)); foreach(Object *ob, objects) { diff --git a/intern/cycles/util/util_cache.h b/intern/cycles/util/util_cache.h index e8f111a5397..deff05fff16 100644 --- a/intern/cycles/util/util_cache.h +++ b/intern/cycles/util/util_cache.h @@ -72,7 +72,7 @@ public: buffers.push_back(buffer); } - void add(void *data, size_t size) + void add(const void *data, size_t size) { if(size) { CacheBuffer buffer(data, size); @@ -80,19 +80,19 @@ public: } } - void add(int& data) + void add(const int& data) { CacheBuffer buffer(&data, sizeof(int)); buffers.push_back(buffer); } - void add(float& data) + void add(const float& data) { CacheBuffer buffer(&data, sizeof(float)); buffers.push_back(buffer); } - void add(size_t& data) + void add(const size_t& data) { CacheBuffer buffer(&data, sizeof(size_t)); buffers.push_back(buffer); |