Fix too much memory usage for Cycles attribute map.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 21 May 2018 09:08:03 +0000 (11:08 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 21 May 2018 09:14:59 +0000 (11:14 +0200)
Thanks to Thomas Krebs for identifying the problem and solution.

intern/cycles/render/mesh.cpp

index 7cfbb7b7c7dbde06fc8e8a95753b27bd0b9cc397..7a9d604244dfebaa7d880250d185d4ffa1f8c88a 100644 (file)
@@ -1307,7 +1307,7 @@ void MeshManager::update_svm_attributes(Device *, DeviceScene *dscene, Scene *sc
                return;
 
        /* create attribute map */
-       uint4 *attr_map = dscene->attributes_map.alloc(attr_map_size*scene->meshes.size());
+       uint4 *attr_map = dscene->attributes_map.alloc(attr_map_size);
        memset(attr_map, 0, dscene->attributes_map.size()*sizeof(uint));
 
        for(size_t i = 0; i < scene->meshes.size(); i++) {