diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-30 17:52:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-30 23:49:41 +0300 |
commit | cb2007906f902e4daeaf773833ef61da4020ea89 (patch) | |
tree | 6195a5f89ff508b1be6e032f48a718ccdbc3d490 /intern/cycles | |
parent | d632ef7c66399bef4686673ae344cbad2a887c2a (diff) |
Cycles: Use bool for is_lead array
This way we save 3 bytes per BVH node while building BVH, which overall
gives 100Mb memory save when preparing Frank for render.
It's not really much comparing to overall memory usage (which is 11Gb
during scene preparation here) but still doesn't harm to have solved.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/bvh/bvh.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/bvh/bvh.h | 2 | ||||
-rw-r--r-- | intern/cycles/render/mesh.cpp | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 376a7f8a656..58775509cfd 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -456,7 +456,7 @@ void BVH::pack_instances(size_t nodes_size) size_t nsize_bbox = (use_qbvh)? 6: 3; int4 *bvh_nodes = &bvh->pack.nodes[0]; size_t bvh_nodes_size = bvh->pack.nodes.size(); - int *bvh_is_leaf = (bvh->pack.is_leaf.size() != 0) ? &bvh->pack.is_leaf[0] : NULL; + bool *bvh_is_leaf = (bvh->pack.is_leaf.size() != 0) ? &bvh->pack.is_leaf[0] : NULL; for(size_t i = 0, j = 0; i < bvh_nodes_size; i+=nsize, j++) { memcpy(pack_nodes + pack_nodes_offset, bvh_nodes + i, nsize_bbox*sizeof(int4)); diff --git a/intern/cycles/bvh/bvh.h b/intern/cycles/bvh/bvh.h index a4a12707768..d0b0ebe206a 100644 --- a/intern/cycles/bvh/bvh.h +++ b/intern/cycles/bvh/bvh.h @@ -63,7 +63,7 @@ struct PackedBVH { array<int> prim_object; /* quick array to lookup if a node is a leaf, not used for traversal, only * for instance BVH merging */ - array<int> is_leaf; + array<bool> is_leaf; /* index of the root node. */ int root_index; diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 9aa0cbcd06d..24d36a1fb0a 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -1124,7 +1124,6 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen } pool.wait_work(); - foreach(Shader *shader, scene->shaders) shader->need_update_attributes = false; |