Commit: 0a3df611e7e2a276a46b421c579cf3efb7a3000a
Author: Michael Jones
Date:   Mon Feb 6 11:12:22 2023 +0000
Branches: master
https://developer.blender.org/rB0a3df611e7e2a276a46b421c579cf3efb7a3000a

Fix T103393: Cycles: Undefine __LIGHT_TREE__ on Metal/AMD to fix perf

This patch fixes T103393 by undefining `__LIGHT_TREE__` on Metal/AMD as it has 
an unexpected & major impact on performance even when light trees are not in 
use.

Patch authored by Prakash Kamliya.

Reviewed By: brecht

Maniphest Tasks: T103393

Differential Revision: https://developer.blender.org/D17167

===================================================================

M       intern/cycles/device/metal/device.mm
M       intern/cycles/kernel/types.h

===================================================================

diff --git a/intern/cycles/device/metal/device.mm 
b/intern/cycles/device/metal/device.mm
index 51e3323370a..5ffd3a09d56 100644
--- a/intern/cycles/device/metal/device.mm
+++ b/intern/cycles/device/metal/device.mm
@@ -55,6 +55,10 @@ void device_metal_info(vector<DeviceInfo> &devices)
     info.denoisers = DENOISER_NONE;
     info.id = id;
 
+    if (MetalInfo::get_device_vendor(device) == METAL_GPU_AMD) {
+      info.has_light_tree = false;
+    }
+
     devices.push_back(info);
     device_index++;
   }
diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h
index cfbaba20ec1..8637c717ddc 100644
--- a/intern/cycles/kernel/types.h
+++ b/intern/cycles/kernel/types.h
@@ -74,7 +74,8 @@ CCL_NAMESPACE_BEGIN
 #define __VOLUME__
 
 /* TODO: solve internal compiler errors and enable light tree on HIP. */
-#ifdef __KERNEL_HIP__
+/* TODO: solve internal compiler perf issue and enable light tree on 
Metal/AMD. */
+#if defined(__KERNEL_HIP__) || defined(__KERNEL_METAL_AMD__)
 #  undef __LIGHT_TREE__
 #endif

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to