From 45f7a5290ba483c2b485c9d0206ee6a349caf4a8 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Tue, 9 May 2023 10:52:19 -0400 Subject: [PATCH] docs(adapter): document `device` and `vendor` IDs repr. --- wgpu-types/src/lib.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 7378883da3..da3b14b26c 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -1303,12 +1303,26 @@ pub enum DeviceType { pub struct AdapterInfo { /// Adapter name pub name: String, - /// Vendor PCI id of the adapter + /// [`Backend`]-specific vendor ID of the adapter /// - /// If the vendor has no PCI id, then this value will be the backend's vendor id equivalent. On Vulkan, - /// Mesa would have a vendor id equivalent to it's `VkVendorId` value. + /// This generally is a 16-bit PCI vendor ID in the least significant bytes of this field. + /// However, more significant bytes may be non-zero if the backend uses a different + /// representation. + /// + /// * For [`Backend::Vulkan`], the [`VkPhysicalDeviceProperties::vendorID`] is used. + /// + /// [`VkPhysicalDeviceProperties::vendorID`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceProperties.html pub vendor: u32, - /// PCI id of the adapter + /// [`Backend`]-specific device ID of the adapter + /// + /// + /// This generally is a 16-bit PCI device ID in the least significant bytes of this field. + /// However, more significant bytes may be non-zero if the backend uses a different + /// representation. + /// + /// * For [`Backend::Vulkan`], the [`VkPhysicalDeviceProperties::deviceID`] is used. + /// + /// [`VkPhysicalDeviceProperties::vendorID`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceProperties.html pub device: u32, /// Type of device pub device_type: DeviceType,