From 0456223cde98712c16cb9b584b5c66c58ec915c3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 May 2021 00:55:22 +0200 Subject: Fix T87793: Cycles OptiX crash hiding objects in viewport render --- intern/cycles/device/device_memory.cpp | 46 +++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'intern/cycles/device/device_memory.cpp') diff --git a/intern/cycles/device/device_memory.cpp b/intern/cycles/device/device_memory.cpp index 9eee86b0814..80a05fc32fe 100644 --- a/intern/cycles/device/device_memory.cpp +++ b/intern/cycles/device/device_memory.cpp @@ -35,10 +35,54 @@ device_memory::device_memory(Device *device, const char *name, MemoryType type) device_pointer(0), host_pointer(0), shared_pointer(0), - shared_counter(0) + shared_counter(0), + original_device_ptr(0), + original_device_size(0), + original_device(0), + need_realloc_(false), + modified(false) { } +device_memory::device_memory(device_memory &&other) noexcept + : data_type(other.data_type), + data_elements(other.data_elements), + data_size(other.data_size), + device_size(other.device_size), + data_width(other.data_width), + data_height(other.data_height), + data_depth(other.data_depth), + type(other.type), + name(other.name), + device(other.device), + device_pointer(other.device_pointer), + host_pointer(other.host_pointer), + shared_pointer(other.shared_pointer), + shared_counter(other.shared_counter), + original_device_ptr(other.original_device_ptr), + original_device_size(other.original_device_size), + original_device(other.original_device), + need_realloc_(other.need_realloc_), + modified(other.modified) +{ + other.data_elements = 0; + other.data_size = 0; + other.device_size = 0; + other.data_width = 0; + other.data_height = 0; + other.data_depth = 0; + other.device = 0; + other.device_pointer = 0; + other.host_pointer = 0; + other.shared_pointer = 0; + other.shared_counter = 0; + other.original_device_ptr = 0; + other.original_device_size = 0; + other.original_device = 0; + other.need_realloc_ = false; + other.modified = false; +} + device_memory::~device_memory() { assert(shared_pointer == 0); -- cgit v1.2.3