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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-24 17:59:17 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-24 18:40:43 +0300
commitec49503a3352c5d431bf54e35118222c3c4fd923 (patch)
tree8f0c661a0dd9a9f2c25e27c1bae099edf17459a3 /intern
parente03df90bf36f907a99ebd8cba6cf03cf05ca71a3 (diff)
Fix T53146: incomplete multi GPU and CPU + GPU memory statistics.
Part due to recent changes, part old bug.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/device/device_multi.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index ed2e46965ac..fd28a9d6188 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -113,6 +113,7 @@ public:
foreach(SubDevice& sub, devices) {
mem.device = sub.device;
mem.device_pointer = 0;
+ mem.device_size = 0;
sub.device->mem_alloc(mem);
sub.ptr_map[key] = mem.device_pointer;
@@ -120,16 +121,19 @@ public:
mem.device = this;
mem.device_pointer = key;
+ stats.mem_alloc(mem.device_size);
}
void mem_copy_to(device_memory& mem)
{
device_ptr existing_key = mem.device_pointer;
device_ptr key = (existing_key)? existing_key: unique_key++;
+ size_t existing_size = mem.device_size;
foreach(SubDevice& sub, devices) {
mem.device = sub.device;
mem.device_pointer = (existing_key)? sub.ptr_map[existing_key]: 0;
+ mem.device_size = existing_size;
sub.device->mem_copy_to(mem);
sub.ptr_map[key] = mem.device_pointer;
@@ -137,6 +141,7 @@ public:
mem.device = this;
mem.device_pointer = key;
+ stats.mem_alloc(mem.device_size - existing_size);
}
void mem_copy_from(device_memory& mem, int y, int w, int h, int elem)
@@ -163,10 +168,12 @@ public:
{
device_ptr existing_key = mem.device_pointer;
device_ptr key = (existing_key)? existing_key: unique_key++;
+ size_t existing_size = mem.device_size;
foreach(SubDevice& sub, devices) {
mem.device = sub.device;
mem.device_pointer = (existing_key)? sub.ptr_map[existing_key]: 0;
+ mem.device_size = existing_size;
sub.device->mem_zero(mem);
sub.ptr_map[key] = mem.device_pointer;
@@ -174,15 +181,18 @@ public:
mem.device = this;
mem.device_pointer = key;
+ stats.mem_alloc(mem.device_size - existing_size);
}
void mem_free(device_memory& mem)
{
device_ptr key = mem.device_pointer;
+ size_t existing_size = mem.device_size;
foreach(SubDevice& sub, devices) {
mem.device = sub.device;
mem.device_pointer = sub.ptr_map[key];
+ mem.device_size = existing_size;
sub.device->mem_free(mem);
sub.ptr_map.erase(sub.ptr_map.find(key));
@@ -190,6 +200,8 @@ public:
mem.device = this;
mem.device_pointer = 0;
+ mem.device_size = 0;
+ stats.mem_free(existing_size);
}
void const_copy_to(const char *name, void *host, size_t size)