winemac.drv: Fix crash when building against Metal-capable SDK but running on older OS X.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50790 Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6f68543692
commit
d52c4eb00c
|
@ -348,10 +348,15 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
|
/* Test if Metal is available */
|
||||||
|
if (&CGDirectDisplayCopyCurrentMetalDevice == NULL)
|
||||||
|
goto done;
|
||||||
|
|
||||||
device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
|
device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
|
||||||
if (device && [device respondsToSelector:@selector(registryID)])
|
if (device && [device respondsToSelector:@selector(registryID)])
|
||||||
ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
|
ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
|
||||||
|
|
||||||
|
done:
|
||||||
[pool release];
|
[pool release];
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue