Fix Cycles assert when resizing rendererd viewport.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 23 Jan 2018 12:01:02 +0000 (13:01 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 23 Jan 2018 12:07:25 +0000 (13:07 +0100)
intern/cycles/device/device_memory.h

index 796c898bc8d8a1e468f7a8866d9d9d941b076594..0f2015ee27c6b500abac1358fd4f7c953d9150d6 100644 (file)
@@ -434,7 +434,10 @@ public:
        void alloc_to_device(size_t width, size_t height, size_t depth = 0)
        {
                device_vector<T>::alloc(width, height, depth);
-               device_memory::device_alloc();
+
+               if(!device_memory::device_pointer) {
+                       device_memory::device_alloc();
+               }
        }
 
        T *copy_from_device(int y, int w, int h)