Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jones <michael_p_jones@apple.com>2021-12-08 18:07:11 +0300
committerMichael Jones <michael_p_jones@apple.com>2021-12-08 18:08:12 +0300
commite23b54a59f0428399bbf4de5ba007ad764fa80be (patch)
treeae2910fbd1582d952ee1c3dfe959b94227e06832 /intern/cycles/device/metal/util.mm
parent5e9dba822d8de977909bf170dcae9950535e01af (diff)
Cycles: Fix OS version warnings
This patch suppresses OS version warnings and hides currently unsupported Metal GPUs when enumerating devices. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13506
Diffstat (limited to 'intern/cycles/device/metal/util.mm')
-rw-r--r--intern/cycles/device/metal/util.mm31
1 files changed, 4 insertions, 27 deletions
diff --git a/intern/cycles/device/metal/util.mm b/intern/cycles/device/metal/util.mm
index d2143c389dc..0a8b0ee6f10 100644
--- a/intern/cycles/device/metal/util.mm
+++ b/intern/cycles/device/metal/util.mm
@@ -45,35 +45,12 @@ MetalGPUVendor MetalInfo::get_vendor_from_device_name(string const &device_name)
bool MetalInfo::device_version_check(id<MTLDevice> device)
{
+ /* Metal Cycles doesn't work correctly on macOS versions older than 12.0 */
if (@available(macos 12.0, *)) {
MetalGPUVendor vendor = get_vendor_from_device_name([[device name] UTF8String]);
-
- static const char *forceIntelStr = getenv("CYCLES_METAL_FORCE_INTEL");
- bool forceIntel = forceIntelStr ? (atoi(forceIntelStr) != 0) : false;
-
- if (forceIntel) {
- /* return false for non-Intel GPUs to force selection of Intel */
- if (vendor == METAL_GPU_INTEL) {
- return true;
- }
- }
- else {
- switch (vendor) {
- case METAL_GPU_INTEL:
- /* isLowPower only returns true on machines that have an AMD GPU also
- * For Intel only machines - isLowPower will return false
- */
- if (getenv("CYCLES_METAL_ALLOW_LOW_POWER_GPUS") || !device.isLowPower) {
- return true;
- }
- return false;
- case METAL_GPU_APPLE:
- case METAL_GPU_AMD:
- return true;
- default:
- return false;
- }
- }
+
+ /* Metal Cycles works on Apple Silicon GPUs at present */
+ return (vendor == METAL_GPU_APPLE);
}
return false;