Cycles: Gray out hardware raytracing checkboxes when not available #117904
|
@ -1685,12 +1685,13 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||
|
||||
import _cycles
|
||||
has_peer_memory = 0
|
||||
has_rt_api_support = False
|
||||
has_rt_api_support = {'METAL': False, 'HIP': False, 'ONEAPI': False}
|
||||
for device in _cycles.available_devices(compute_device_type):
|
||||
if device[3] and self.find_existing_device_entry(device).use:
|
||||
has_peer_memory += 1
|
||||
if device[4] and self.find_existing_device_entry(device).use:
|
||||
has_rt_api_support = True
|
||||
device_type = device[1]
|
||||
has_rt_api_support[device_type] = True
|
||||
|
||||
if has_peer_memory > 1:
|
||||
row = layout.row()
|
||||
|
@ -1708,25 +1709,25 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||
|
||||
# MetalRT only works on Apple Silicon and Navi2.
|
||||
is_arm64 = platform.machine() == 'arm64'
|
||||
if is_arm64 or (is_navi_2 and has_rt_api_support):
|
||||
if is_arm64 or (is_navi_2 and has_rt_api_support['METAL']):
|
||||
col = layout.column()
|
||||
col.use_property_split = True
|
||||
# Kernel specialization is only supported on Apple Silicon
|
||||
if is_arm64:
|
||||
col.prop(self, "kernel_optimization_level")
|
||||
if has_rt_api_support:
|
||||
if has_rt_api_support['METAL']:
|
||||
|
||||
col.prop(self, "metalrt")
|
||||
|
||||
if compute_device_type == 'HIP':
|
||||
import platform
|
||||
if platform.system() == "Windows": # HIP-RT is currently only supported on Windows
|
||||
has_cuda, has_optix, has_hip, has_metal, has_oneapi, has_hiprt = _cycles.get_device_types()
|
||||
row = layout.row()
|
||||
row.enabled = has_hiprt
|
||||
row.active = has_rt_api_support['HIP']
|
||||
Sirgienko marked this conversation as resolved
Outdated
Brecht Van Lommel
commented
Use Use `row.active`. No reason to disallow toggling the option entirely, just graying out is enough.
|
||||
row.prop(self, "use_hiprt")
|
||||
|
||||
elif compute_device_type == 'ONEAPI' and _cycles.with_embree_gpu:
|
||||
row = layout.row()
|
||||
row.active = has_rt_api_support['ONEAPI']
|
||||
Sirgienko marked this conversation as resolved
Outdated
Brecht Van Lommel
commented
Same comment. Same comment.
|
||||
row.prop(self, "use_oneapirt")
|
||||
|
||||
def draw(self, context):
|
||||
|
|
Loading…
Reference in New Issue
We could gray out here too for consistency, as you mentioned.
I could, but I have decided to leave this change to the Apple people - maybe they have some strong opinion why this option should disappear on MacOS instead of being gray out.
Ok, does not need to be done as part of this PR.