On Tue May 14 12:04:08 2024 +0000, Rémi Bernon wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/5616/diffs?diff_id=113599&start_sha=0b52f888c5344a5292aebc050f516ea01ad4128f#088bf0bfc689b10bf8f4d5be0a2a598b65cb6e95_625_592)
I think that although there's no specific ordering, there's also only the winemac driver over metal that exposes multiple GPUs without having proper PCI id. In this particular case we could perhaps still find a way to match the Vulkan device, as we compute some fake device ID (but I haven't investigated that at all).
Other drivers expose a single GPU, and in this case we can probably map it to any vulkan GPU as a better than nothing fallback. I don't think winewayland for instance will be able to return GPU identification but we still need to expose some proper Vulkan GPU info anyway.
I've changed the code to enumerate Vulkan GPUs instead, and use that list to match the gpus which are added. This should improve the matching quality, as it will also match against the driver reported Vulkan uuid if there's any, then use PCI id as a fallback (while better supporting duplicated devices), and index as a last resort.