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:
authorPatrick Mours <pmours@nvidia.com>2019-12-05 21:17:01 +0300
committerPatrick Mours <pmours@nvidia.com>2019-12-09 16:32:12 +0300
commitbaeb11826b9fe5525db6dd05ba5271949079fc1e (patch)
tree9d646d69ef51c3fb1dab3d76798936160b1560f9 /intern/cycles/device/device_memory.h
parentc9dc57be3ae59fac84b243f8bfdaddaa9b5e2f20 (diff)
Cycles: Add OptiX acceleration structure compaction
This adds compaction support for OptiX acceleration structures, which reduces the device memory footprint in a post step after building. Depending on the scene this can reduce the amount of used device memory quite a bit and even improve performance (smaller acceleration structure improves cache usage). It's only enabled for background renders to make acceleration structure builds fast in viewport. Also fixes a bug in the memory management for OptiX acceleration structures: These were held in a dynamic vector of 'device_memory' instances and used the mem_alloc/mem_free functions. However, those keep track of memory instances in the 'cuda_mem_map' via pointers to 'device_memory' (which works fine everywhere else since those are never copied/moved). But in the case of the vector, it may decide to reallocate at some point, which invalidates those pointers and would result in some nasty accesses to invalid memory. So it is not actually safe to move a 'device_memory' object and therefore this removes the move operator overloads again. Reviewed By: brecht Differential Revision: https://developer.blender.org/D6369
Diffstat (limited to 'intern/cycles/device/device_memory.h')
-rw-r--r--intern/cycles/device/device_memory.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h
index f8324e2a214..60740807568 100644
--- a/intern/cycles/device/device_memory.h
+++ b/intern/cycles/device/device_memory.h
@@ -235,9 +235,6 @@ class device_memory {
device_memory(const device_memory &) = delete;
device_memory &operator=(const device_memory &) = delete;
- /* But moving is possible. */
- device_memory(device_memory &&);
-
/* Host allocation on the device. All host_pointer memory should be
* allocated with these functions, for devices that support using
* the same pointer for host and device. */
@@ -275,11 +272,6 @@ template<typename T> class device_only_memory : public device_memory {
free();
}
- device_only_memory(device_only_memory &&other)
- : device_memory(static_cast<device_memory &&>(other))
- {
- }
-
void alloc_to_device(size_t num, bool shrink_to_fit = true)
{
size_t new_size = num;
@@ -338,10 +330,6 @@ template<typename T> class device_vector : public device_memory {
free();
}
- device_vector(device_vector &&other) : device_memory(static_cast<device_memory &&>(other))
- {
- }
-
/* Host memory allocation. */
T *alloc(size_t width, size_t height = 0, size_t depth = 0)
{