MTLUtil: Don't attempt to get all GPUs on non-macOS platforms

This commit is contained in:
OatmealDome 2022-07-23 04:28:50 -04:00
parent 50d3ad58df
commit 7edd3aff75
1 changed files with 3 additions and 0 deletions

View File

@ -22,12 +22,15 @@ std::vector<MRCOwned<id<MTLDevice>>> Metal::Util::GetAdapterList()
if (default_dev)
list.push_back(MRCTransfer(default_dev));
#if TARGET_OS_OSX
auto devices = MRCTransfer(MTLCopyAllDevices());
for (id<MTLDevice> device in devices.Get())
{
if (device != default_dev)
list.push_back(MRCRetain(device));
}
#endif
return list;
}