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
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/device/device_memory.cpp')
-rw-r--r--intern/cycles/device/device_memory.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/intern/cycles/device/device_memory.cpp b/intern/cycles/device/device_memory.cpp
index c6248fcf88b..482af685011 100644
--- a/intern/cycles/device/device_memory.cpp
+++ b/intern/cycles/device/device_memory.cpp
@@ -104,6 +104,26 @@ void device_memory::device_zero()
}
}
+void device_memory::swap_device(Device *new_device,
+ size_t new_device_size,
+ device_ptr new_device_ptr)
+{
+ original_device = device;
+ original_device_size = device_size;
+ original_device_ptr = device_pointer;
+
+ device = new_device;
+ device_size = new_device_size;
+ device_pointer = new_device_ptr;
+}
+
+void device_memory::restore_device()
+{
+ device = original_device;
+ device_size = original_device_size;
+ device_pointer = original_device_ptr;
+}
+
/* Device Sub Ptr */
device_sub_ptr::device_sub_ptr(device_memory& mem, int offset, int size)