diff options
Diffstat (limited to 'intern/cycles/blender/addon')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 26 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 4 |
2 files changed, 25 insertions, 5 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 17f05f6da34..7d7ca78c15a 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -118,7 +118,8 @@ enum_device_type = ( ('CUDA', "CUDA", "CUDA", 1), ('OPTIX', "OptiX", "OptiX", 3), ('HIP', "HIP", "HIP", 4), - ('METAL', "Metal", "Metal", 5) + ('METAL', "Metal", "Metal", 5), + ('ONEAPI', "oneAPI", "oneAPI", 6) ) enum_texture_limit = ( @@ -1397,7 +1398,8 @@ class CyclesPreferences(bpy.types.AddonPreferences): def get_device_types(self, context): import _cycles - has_cuda, has_optix, has_hip, has_metal = _cycles.get_device_types() + has_cuda, has_optix, has_hip, has_metal, has_oneapi = _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)) @@ -1407,6 +1409,8 @@ class CyclesPreferences(bpy.types.AddonPreferences): list.append(('HIP', "HIP", "Use HIP for GPU acceleration", 4)) if has_metal: list.append(('METAL', "Metal", "Use Metal for GPU acceleration", 5)) + if has_oneapi: + list.append(('ONEAPI', "oneAPI", "Use oneAPI for GPU acceleration", 6)) return list @@ -1438,7 +1442,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', 'METAL'}: + if not device[1] in {'CUDA', 'OPTIX', 'CPU', 'HIP', 'METAL', 'ONEAPI'}: continue # Try to find existing Device entry entry = self.find_existing_device_entry(device) @@ -1482,7 +1486,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', 'METAL'): + for device_type in ('CUDA', 'OPTIX', 'HIP', 'METAL', 'ONEAPI'): self.update_device_entries(_cycles.available_devices(device_type)) # Deprecated: use refresh_devices instead. @@ -1550,13 +1554,25 @@ class CyclesPreferences(bpy.types.AddonPreferences): elif sys.platform.startswith("linux"): col.label(text="Requires AMD GPU with Vega or RDNA architecture", icon='BLANK1') col.label(text="and AMD driver version 22.10 or newer", icon='BLANK1') + elif device_type == 'ONEAPI': + import sys + col.label(text="Requires Intel GPU with Xe-HPG architecture", icon='BLANK1') + if sys.platform.startswith("win"): + col.label(text="and Windows driver version 101.1660 or newer", icon='BLANK1') + elif sys.platform.startswith("linux"): + col.label(text="and Linux driver version xx.xx.20066 or newer", icon='BLANK1') elif device_type == 'METAL': col.label(text="Requires Apple Silicon with macOS 12.2 or newer", icon='BLANK1') col.label(text="or AMD with macOS 12.3 or newer", icon='BLANK1') return for device in devices: - box.prop(device, "use", text=device.name) + import unicodedata + box.prop(device, "use", text=device.name + .replace('(TM)', unicodedata.lookup('TRADE MARK SIGN')) + .replace('(R)', unicodedata.lookup('REGISTERED SIGN')) + .replace('(C)', unicodedata.lookup('COPYRIGHT SIGN')) + ) def draw_impl(self, layout, context): row = layout.row() diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 88be546746d..5b8c3960c82 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -110,6 +110,10 @@ def use_optix(context): return (get_device_type(context) == 'OPTIX' and cscene.device == 'GPU') +def use_oneapi(context): + cscene = context.scene.cycles + + return (get_device_type(context) == 'ONEAPI' and cscene.device == 'GPU') def use_multi_device(context): cscene = context.scene.cycles |