[Bf-blender-cvs] [333dc8d60f] master: Fix T50719: Memory usage won't reset to zero while re-rendering on two video cards

Sergey Sharybin noreply at git.blender.org
Mon Feb 20 11:03:03 CET 2017


Commit: 333dc8d60ff4589fe73a7d0f63c3f7589d6b345a
Author: Sergey Sharybin
Date:   Mon Feb 20 11:02:19 2017 +0100
Branches: master
https://developer.blender.org/rB333dc8d60ff4589fe73a7d0f63c3f7589d6b345a

Fix T50719: Memory usage won't reset to zero while re-rendering on two video cards

Was only visible with Persistent Images option ON.

===================================================================

M	intern/cycles/device/device_multi.cpp

===================================================================

diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 31b800640d..61d78ee65d 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -162,6 +162,7 @@ public:
 	void mem_free(device_memory& mem)
 	{
 		device_ptr tmp = mem.device_pointer;
+		stats.mem_free(mem.device_size);
 
 		foreach(SubDevice& sub, devices) {
 			mem.device_pointer = sub.ptr_map[tmp];
@@ -170,7 +171,6 @@ public:
 		}
 
 		mem.device_pointer = 0;
-		stats.mem_free(mem.device_size);
 	}
 
 	void const_copy_to(const char *name, void *host, size_t size)
@@ -202,6 +202,7 @@ public:
 	void tex_free(device_memory& mem)
 	{
 		device_ptr tmp = mem.device_pointer;
+		stats.mem_free(mem.device_size);
 
 		foreach(SubDevice& sub, devices) {
 			mem.device_pointer = sub.ptr_map[tmp];
@@ -210,7 +211,6 @@ public:
 		}
 
 		mem.device_pointer = 0;
-		stats.mem_free(mem.device_size);
 	}
 
 	void pixels_alloc(device_memory& mem)




More information about the Bf-blender-cvs mailing list