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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-20 05:32:29 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-21 21:58:28 +0300
commit57a0cb797d60024357a3e3a64c1873844b0178bd (patch)
tree1f8ade576fbbc6cbbf7a41c51304ee8ae3fe95b6 /intern/cycles/util
parent92ec4863c22f249a21a5b5224d91fcab5c602100 (diff)
Code refactor: avoid some unnecessary device memory copying.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_vector.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h
index 4add91a3368..9e74505b14a 100644
--- a/intern/cycles/util/util_vector.h
+++ b/intern/cycles/util/util_vector.h
@@ -273,6 +273,15 @@ public:
push_back_slow(t);
}
+ void append(const array<T>& from)
+ {
+ if(from.size()) {
+ size_t old_size = size();
+ resize(old_size + from.size());
+ memcpy(data_ + old_size, from.data(), sizeof(T) * from.size());
+ }
+ }
+
protected:
inline T* mem_allocate(size_t N)
{