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
path: root/intern
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2015-09-24 17:49:10 +0300
committerThomas Dinges <blender@dingto.org>2015-09-24 17:49:10 +0300
commit97a3fa17d6bb959b3b3c78e5628ca90a98fd827d (patch)
treee57edc9e2e54c38f9dff5e7cd759e91283d398ec /intern
parentdfadf18659fc6252b745b83ceb185a55dea4a2c7 (diff)
Cleanup: Remove some more BVH cache code, for reading/writing the cache.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/bvh/bvh.cpp101
-rw-r--r--intern/cycles/bvh/bvh.h5
2 files changed, 0 insertions, 106 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index c8c885487e4..4a5f8b1bda6 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -25,7 +25,6 @@
#include "bvh_node.h"
#include "bvh_params.h"
-#include "util_cache.h"
#include "util_debug.h"
#include "util_foreach.h"
#include "util_logging.h"
@@ -70,104 +69,12 @@ BVH *BVH::create(const BVHParams& params, const vector<Object*>& objects)
return new RegularBVH(params, objects);
}
-/* Cache */
-
-bool BVH::cache_read(CacheData& key)
-{
- key.add(system_cpu_bits());
- key.add(&params, sizeof(params));
-
- foreach(Object *ob, objects) {
- Mesh *mesh = ob->mesh;
-
- key.add(mesh->verts);
- key.add(mesh->triangles);
- key.add(mesh->curve_keys);
- key.add(mesh->curves);
- key.add(&ob->bounds, sizeof(ob->bounds));
- key.add(&ob->visibility, sizeof(ob->visibility));
- key.add(&mesh->transform_applied, sizeof(bool));
-
- if(mesh->use_motion_blur) {
- Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
- if(attr)
- key.add(attr->buffer);
-
- attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
- if(attr)
- key.add(attr->buffer);
- }
- }
-
- CacheData value;
-
- if(Cache::global.lookup(key, value)) {
-
- if(!(value.read(pack.root_index) &&
- value.read(pack.SAH) &&
- value.read(pack.nodes) &&
- value.read(pack.leaf_nodes) &&
- value.read(pack.object_node) &&
- value.read(pack.tri_woop) &&
- value.read(pack.prim_type) &&
- value.read(pack.prim_visibility) &&
- value.read(pack.prim_index) &&
- value.read(pack.prim_object)))
- {
- /* Clear the pack if load failed. */
- pack.root_index = 0;
- pack.SAH = 0.0f;
- pack.nodes.clear();
- pack.leaf_nodes.clear();
- pack.object_node.clear();
- pack.tri_woop.clear();
- pack.prim_type.clear();
- pack.prim_visibility.clear();
- pack.prim_index.clear();
- pack.prim_object.clear();
- return false;
- }
- return true;
- }
-
- return false;
-}
-
-void BVH::cache_write(CacheData& key)
-{
- CacheData value;
-
- value.add(pack.root_index);
- value.add(pack.SAH);
-
- value.add(pack.nodes);
- value.add(pack.leaf_nodes);
- value.add(pack.object_node);
- value.add(pack.tri_woop);
- value.add(pack.prim_type);
- value.add(pack.prim_visibility);
- value.add(pack.prim_index);
- value.add(pack.prim_object);
-
- Cache::global.insert(key, value);
-}
-
/* Building */
void BVH::build(Progress& progress)
{
progress.set_substatus("Building BVH");
- /* cache read */
- CacheData key("bvh");
-
- if(params.use_cache) {
- progress.set_substatus("Looking in BVH cache");
-
- if(cache_read(key))
- return;
- }
-
/* build nodes */
BVHBuild bvh_build(objects,
pack.prim_type,
@@ -206,14 +113,6 @@ void BVH::build(Progress& progress)
/* free build nodes */
root->deleteSubtree();
-
- if(progress.get_cancel()) return;
-
- /* cache write */
- if(params.use_cache) {
- progress.set_substatus("Writing BVH cache");
- cache_write(key);
- }
}
/* Refitting */
diff --git a/intern/cycles/bvh/bvh.h b/intern/cycles/bvh/bvh.h
index 0ee5a309dc8..272a3fa1514 100644
--- a/intern/cycles/bvh/bvh.h
+++ b/intern/cycles/bvh/bvh.h
@@ -29,7 +29,6 @@ class BVHNode;
struct BVHStackEntry;
class BVHParams;
class BoundBox;
-class CacheData;
class LeafNode;
class Object;
class Progress;
@@ -96,10 +95,6 @@ public:
protected:
BVH(const BVHParams& params, const vector<Object*>& objects);
- /* cache */
- bool cache_read(CacheData& key);
- void cache_write(CacheData& key);
-
/* triangles and strands*/
void pack_primitives();
void pack_triangle(int idx, float4 woop[3]);