diff options
author | Michael Jones <michael_p_jones@apple.com> | 2021-12-07 18:11:35 +0300 |
---|---|---|
committer | Michael Jones <michael_p_jones@apple.com> | 2021-12-07 18:52:21 +0300 |
commit | 9558fa5196033390111a2348caa66ab18b8a4f89 (patch) | |
tree | acc3ed446f709390abfef5f97f82c1ed9abe0100 /intern/cycles/blender/addon/properties.py | |
parent | 565b33c0ad31966b860123837d2c4b5a8cbedad2 (diff) |
Cycles: Metal host-side code
This patch adds the Metal host-side code:
- Add all core host-side Metal backend files (device_impl, queue, etc)
- Add MetalRT BVH setup files
- Integrate with Cycles device enumeration code
- Revive `path_source_replace_includes` in util/path (required for MSL compilation)
This patch also includes a couple of small kernel-side fixes:
- Add an implementation of `lgammaf` for Metal [Nemes, Gergő (2010), "New asymptotic expansion for the Gamma function", Archiv der Mathematik](https://users.renyi.hu/~gergonemes/)
- include "work_stealing.h" inside the Metal context class because it accesses state now
Ref T92212
Reviewed By: brecht
Maniphest Tasks: T92212
Differential Revision: https://developer.blender.org/D13423
Diffstat (limited to 'intern/cycles/blender/addon/properties.py')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 0de936ddb11..8569cb7d946 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -111,7 +111,8 @@ enum_device_type = ( ('CPU', "CPU", "CPU", 0), ('CUDA', "CUDA", "CUDA", 1), ('OPTIX', "OptiX", "OptiX", 3), - ("HIP", "HIP", "HIP", 4) + ('HIP', "HIP", "HIP", 4), + ('METAL', "Metal", "Metal", 5) ) enum_texture_limit = ( @@ -1312,8 +1313,7 @@ class CyclesPreferences(bpy.types.AddonPreferences): def get_device_types(self, context): import _cycles - has_cuda, has_optix, has_hip = _cycles.get_device_types() - + has_cuda, has_optix, has_hip, has_metal = _cycles.get_device_types() list = [('NONE', "None", "Don't use compute device", 0)] if has_cuda: list.append(('CUDA', "CUDA", "Use CUDA for GPU acceleration", 1)) @@ -1321,6 +1321,8 @@ class CyclesPreferences(bpy.types.AddonPreferences): list.append(('OPTIX', "OptiX", "Use OptiX for GPU acceleration", 3)) if has_hip: list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4)) + if has_metal: + list.append(('METAL', "Metal", "Use Metal for GPU acceleration", 5)) return list @@ -1346,7 +1348,7 @@ class CyclesPreferences(bpy.types.AddonPreferences): def update_device_entries(self, device_list): for device in device_list: - if not device[1] in {'CUDA', 'OPTIX', 'CPU', 'HIP'}: + if not device[1] in {'CUDA', 'OPTIX', 'CPU', 'HIP', 'METAL'}: continue # Try to find existing Device entry entry = self.find_existing_device_entry(device) @@ -1390,7 +1392,7 @@ class CyclesPreferences(bpy.types.AddonPreferences): import _cycles # Ensure `self.devices` is not re-allocated when the second call to # get_devices_for_type is made, freeing items from the first list. - for device_type in ('CUDA', 'OPTIX', 'HIP'): + for device_type in ('CUDA', 'OPTIX', 'HIP', 'METAL'): self.update_device_entries(_cycles.available_devices(device_type)) # Deprecated: use refresh_devices instead. |