There are [registry keys we don't set if a device doesn't have a device ID](https://gitlab.winehq.org/wine/wine/-/blob/98b73b5c32fa82218081f0e7668f9836f...). Diablo IV refuses to start if you don't have them.
From: Evan Tang etang@codeweavers.com
--- dlls/winemac.drv/cocoa_display.m | 35 ++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m index b5096a39ca4..b2608bafcd0 100644 --- a/dlls/winemac.drv/cocoa_display.m +++ b/dlls/winemac.drv/cocoa_display.m @@ -256,6 +256,37 @@ static int macdrv_get_gpu_info_from_registry_id(struct macdrv_gpu* gpu, uint64_t return ret; }
+/*********************************************************************** + * macdrv_get_gpu_info_from_mtldevice + * + * Get GPU information from a Metal device that responds to the registryID selector. + * + * Returns non-zero value on failure. + */ +static int macdrv_get_gpu_info_from_mtldevice(struct macdrv_gpu* gpu, id<MTLDevice> device) +{ + int ret; + if ((ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]))) + return ret; + /* Apple GPUs aren't PCI devices and therefore have no device ID + * Use the Metal GPUFamily as the device ID */ + if (!gpu->device_id && [device respondsToSelector:@selector(supportsFamily:)] && [device supportsFamily:MTLGPUFamilyApple1]) + { + MTLGPUFamily highest = MTLGPUFamilyApple1; + while (1) + { + /* Apple2, etc are all in order */ + MTLGPUFamily next = highest + 1; + if ([device supportsFamily:next]) + highest = next; + else + break; + } + gpu->device_id = highest; + } + return 0; +} + /*********************************************************************** * macdrv_get_gpus_from_metal * @@ -289,7 +320,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count) * the primary GPU because we need to hide the integrated GPU for an automatic graphic switching pair to avoid apps * using the integrated GPU. This is the behavior of Windows on a Mac. */ primary_device = [MTLCreateSystemDefaultDevice() autorelease]; - if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, primary_device.registryID)) + if (macdrv_get_gpu_info_from_mtldevice(&primary_gpu, primary_device)) goto done;
/* Hide the integrated GPU if the system default device is a dedicated GPU */ @@ -301,7 +332,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
for (i = 0; i < devices.count; i++) { - if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], devices[i].registryID)) + if (macdrv_get_gpu_info_from_mtldevice(&gpus[gpu_count], devices[i])) goto done;
if (hide_integrated && devices[i].isLowPower)