diff options
Diffstat (limited to 'intern/cycles/device/device_memory.h')
-rw-r--r-- | intern/cycles/device/device_memory.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h index 5b5b4dc6802..b69c3dad604 100644 --- a/intern/cycles/device/device_memory.h +++ b/intern/cycles/device/device_memory.h @@ -180,10 +180,27 @@ public: /* device pointer */ device_ptr device_pointer; -protected: - device_memory() {} + device_memory() + { + data_type = device_type_traits<uchar>::data_type; + data_elements = device_type_traits<uchar>::num_elements; + data_pointer = 0; + data_size = 0; + device_size = 0; + data_width = 0; + data_height = 0; + data_depth = 0; + device_pointer = 0; + } virtual ~device_memory() { assert(!device_pointer); } + void resize(size_t size) + { + data_size = size; + data_width = size; + } + +protected: /* no copying */ device_memory(const device_memory&); device_memory& operator = (const device_memory&); @@ -198,16 +215,8 @@ public: { data_type = device_type_traits<T>::data_type; data_elements = device_type_traits<T>::num_elements; - data_pointer = 0; - data_size = 0; - device_size = 0; - data_width = 0; - data_height = 0; - data_depth = 0; assert(data_elements > 0); - - device_pointer = 0; } virtual ~device_vector() {} @@ -266,6 +275,7 @@ public: data_height = 0; data_depth = 0; data_size = 0; + device_pointer = 0; } size_t size() |