diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 12 | ||||
-rw-r--r-- | intern/cycles/blender/device.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/device/device.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device.h | 2 | ||||
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 1 |
5 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 1afb321da3d..01e73d7ed03 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1374,6 +1374,12 @@ class CyclesPreferences(bpy.types.AddonPreferences): default=False, ) + use_metalrt: BoolProperty( + name="MetalRT (Experimental)", + description="MetalRT for ray tracing uses less memory for scenes which use curves extensively, and can give better performance in specific cases. However this support is experimental and some scenes may render incorrectly", + default=False, + ) + def find_existing_device_entry(self, device): for device_entry in self.devices: if device_entry.id == device[2] and device_entry.type == device[1]: @@ -1519,6 +1525,12 @@ class CyclesPreferences(bpy.types.AddonPreferences): row.use_property_split = True row.prop(self, "peer_memory") + if compute_device_type == 'METAL': + row = layout.row() + row.use_property_split = True + row.prop(self, "use_metalrt") + + def draw(self, context): self.draw_impl(self.layout, context) diff --git a/intern/cycles/blender/device.cpp b/intern/cycles/blender/device.cpp index d39381ac6f1..d7feb7d66b2 100644 --- a/intern/cycles/blender/device.cpp +++ b/intern/cycles/blender/device.cpp @@ -118,6 +118,10 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen device.has_peer_memory = false; } + if (get_boolean(cpreferences, "use_metalrt")) { + device.use_metalrt = true; + } + return device; } diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 4d981e45ff1..bd7dd60e58a 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -328,6 +328,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices, info.has_osl = true; info.has_profiling = true; info.has_peer_memory = false; + info.use_metalrt = false; info.denoisers = DENOISER_ALL; foreach (const DeviceInfo &device, subdevices) { @@ -374,6 +375,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices, info.has_osl &= device.has_osl; info.has_profiling &= device.has_profiling; info.has_peer_memory |= device.has_peer_memory; + info.use_metalrt |= device.use_metalrt; info.denoisers &= device.denoisers; } diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index c032773ddd0..544fe5b4a35 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -79,6 +79,7 @@ class DeviceInfo { bool has_profiling; /* Supports runtime collection of profiling info. */ bool has_peer_memory; /* GPU has P2P access to memory of another GPU. */ bool has_gpu_queue; /* Device supports GPU queue. */ + bool use_metalrt; /* Use MetalRT to accelerate ray queries (Metal only). */ DenoiserTypeMask denoisers; /* Supported denoiser types. */ int cpu_threads; vector<DeviceInfo> multi_devices; @@ -96,6 +97,7 @@ class DeviceInfo { has_profiling = false; has_peer_memory = false; has_gpu_queue = false; + use_metalrt = false; denoisers = DENOISER_NONE; } diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 251ba54e477..cdaafc60ab0 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -100,6 +100,7 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile } } + use_metalrt = info.use_metalrt; if (auto metalrt = getenv("CYCLES_METALRT")) { use_metalrt = (atoi(metalrt) != 0); } |