Let's say I have more physical devices supporting Vulkan (dedicated + integrated GPU, or 2 dedicated, or other possibilities). The user can choose the device to use in the options screen. I need to be able to persist his choice on disk.
What field can I use to uniquely identify a physical device across different executions?
vendorID+deviceIDis not enough: I could have 2 identical GPUs connecteddeviceNameis not enough for the same reasondeviceLUIDis not guaranteed to be present, and may have the same problems asdeviceUUID(below)deviceUUIDlooks like the correct choice, but the spec says:While
VkPhysicalDeviceIDPropertiesKHR::deviceUUIDis specified to remain consistent across driver versions and system reboots, it is not intended to be usable as a serializable persistent identifier for a device. It may change when a device is physically added to, removed from, or moved to a different connector in a system while that system is powered down.
So... what should I use?