diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-20 05:32:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-21 21:58:28 +0300 |
commit | 57a0cb797d60024357a3e3a64c1873844b0178bd (patch) | |
tree | 1f8ade576fbbc6cbbf7a41c51304ee8ae3fe95b6 /intern/cycles/render/tables.cpp | |
parent | 92ec4863c22f249a21a5b5224d91fcab5c602100 (diff) |
Code refactor: avoid some unnecessary device memory copying.
Diffstat (limited to 'intern/cycles/render/tables.cpp')
-rw-r--r-- | intern/cycles/render/tables.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/render/tables.cpp b/intern/cycles/render/tables.cpp index bf1ef12d602..c08c83cfe11 100644 --- a/intern/cycles/render/tables.cpp +++ b/intern/cycles/render/tables.cpp @@ -90,7 +90,9 @@ size_t LookupTables::add_table(DeviceScene *dscene, vector<float>& data) } /* copy table data and return offset */ - dscene->lookup_table.copy_at(&data[0], new_table.offset, data.size()); + float *dtable = dscene->lookup_table.get_data(); + memcpy(dtable + new_table.offset, &data[0], sizeof(float) * data.size()); + return new_table.offset; } |