graphics() XML parser improvement (macOS)
This commit is contained in:
+12
-1
@@ -103,6 +103,17 @@ function getVendorFromId(id) {
|
||||
return vendors[id] || '';
|
||||
}
|
||||
|
||||
function vendorToId(str) {
|
||||
let result = '';
|
||||
str = (str || '').toLowerCase();
|
||||
if (str.indexOf('apple') >= 0) { result = '0x05ac'; }
|
||||
else if (str.indexOf('nvidia') >= 0) { result = '0x10de'; }
|
||||
else if (str.indexOf('intel') >= 0) { result = '0x8086'; }
|
||||
else if (str.indexOf('ati') >= 0 || str.indexOf('amd') >= 0) { result = '0x1002'; }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function getMetalVersion(id) {
|
||||
const families = {
|
||||
'spdisplays_mtlgpufamilymac1': 'mac1',
|
||||
@@ -139,7 +150,7 @@ function graphics(callback) {
|
||||
vramDynamic: bus === 'Built-In',
|
||||
vram: vram || vramDyn || 0,
|
||||
deviceId: item['spdisplays_device-id'] || '',
|
||||
vendorId: item['spdisplays_vendor-id'] || '',
|
||||
vendorId: item['spdisplays_vendor-id'] || vendorToId((item['spdisplays_vendor'] || '') + (item.sppci_model || '')),
|
||||
external: (item.sppci_device_type === 'spdisplays_egpu'),
|
||||
cores: item['sppci_cores'] || null,
|
||||
metalVersion
|
||||
|
||||
Reference in New Issue
Block a user