Cycles: Make all #include statements relative to cycles source directory
[blender.git] / intern / cycles / device / device_multi.cpp
index 31b800640d390d93c7b0ae684edd823392dba1ac..624260a81c80346de0ddabbf908aaf37b464273d 100644 (file)
 #include <stdlib.h>
 #include <sstream>
 
-#include "device.h"
-#include "device_intern.h"
-#include "device_network.h"
+#include "device/device.h"
+#include "device/device_intern.h"
+#include "device/device_network.h"
 
-#include "buffers.h"
+#include "render/buffers.h"
 
-#include "util_foreach.h"
-#include "util_list.h"
-#include "util_logging.h"
-#include "util_map.h"
-#include "util_time.h"
+#include "util/util_foreach.h"
+#include "util/util_list.h"
+#include "util/util_logging.h"
+#include "util/util_map.h"
+#include "util/util_time.h"
 
 CCL_NAMESPACE_BEGIN
 
@@ -106,11 +106,11 @@ public:
                return true;
        }
 
-       void mem_alloc(device_memory& mem, MemoryType type)
+       void mem_alloc(const char *name, device_memory& mem, MemoryType type)
        {
                foreach(SubDevice& sub, devices) {
                        mem.device_pointer = 0;
-                       sub.device->mem_alloc(mem, type);
+                       sub.device->mem_alloc(name, mem, type);
                        sub.ptr_map[unique_ptr] = mem.device_pointer;
                }
 
@@ -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)