Class VkPhysicalDeviceIDProperties

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
    Direct Known Subclasses:
    VkPhysicalDeviceIDPropertiesKHR

    public class VkPhysicalDeviceIDProperties
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying IDs related to the physical device.
    Description

    If the VkPhysicalDeviceIDProperties structure is included in the pNext chain of the VkPhysicalDeviceProperties2 structure passed to GetPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

    deviceUUID must be immutable for a given device across instances, processes, driver APIs, driver versions, and system reboots.

    Applications can compare the driverUUID value across instance and process boundaries, and can make similar queries in external APIs to determine whether they are capable of sharing memory objects and resources using them with the device.

    deviceUUID and/or driverUUID must be used to determine whether a particular external object can be shared between driver components, where such a restriction exists as defined in the compatibility table for the particular object type:

    If deviceLUIDValid is FALSE, the values of deviceLUID and deviceNodeMask are undefined. If deviceLUIDValid is TRUE and Vulkan is running on the Windows operating system, the contents of deviceLUID can be cast to an LUID object and must be equal to the locally unique identifier of a IDXGIAdapter1 object that corresponds to physicalDevice. If deviceLUIDValid is TRUE, deviceNodeMask must contain exactly one bit. If Vulkan is running on an operating system that supports the Direct3D 12 API and physicalDevice corresponds to an individual device in a linked device adapter, deviceNodeMask identifies the Direct3D 12 node corresponding to physicalDevice. Otherwise, deviceNodeMask must be 1.

    Note

    Although they have identical descriptions, VkPhysicalDeviceIDProperties::deviceUUID may differ from VkPhysicalDeviceProperties2::pipelineCacheUUID. The former is intended to identify and correlate devices across API and driver boundaries, while the latter is used to identify a compatible device and driver combination to use when serializing and de-serializing pipeline state.

    Implementations should return deviceUUID values which are likely to be unique even in the presence of multiple Vulkan implementations (such as a GPU driver and a software renderer; two drivers for different GPUs; or the same Vulkan driver running on two logically different devices).

    Khronos' conformance testing can not guarantee that deviceUUID values are actually unique, so implementors should make their own best efforts to ensure this. In particular, hard-coded deviceUUID values, especially all-0 bits, should never be used.

    A combination of values unique to the vendor, the driver, and the hardware environment can be used to provide a deviceUUID which is unique to a high degree of certainty. Some possible inputs to such a computation are:

    • Information reported by GetPhysicalDeviceProperties
    • PCI device ID (if defined)
    • PCI bus ID, or similar system configuration information.
    • Driver binary checksums.
    Note

    While VkPhysicalDeviceIDProperties::deviceUUID is 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. Further, there is no reasonable way to verify with conformance testing that a given device retains the same UUID in a given system across all driver versions supported in that system. While implementations should make every effort to report consistent device UUIDs across driver versions, applications should avoid relying on the persistence of this value for uses other than identifying compatible devices for external object sharing purposes.

    Valid Usage (Implicit)

    Layout

    
     struct VkPhysicalDeviceIDProperties {
         VkStructureType sType();
         void * pNext();
         uint8_t deviceUUID()[VK_UUID_SIZE];
         uint8_t driverUUID()[VK_UUID_SIZE];
         uint8_t deviceLUID()[VK_LUID_SIZE];
         uint32_t deviceNodeMask();
         VkBool32 deviceLUIDValid();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, DEVICEUUID, DRIVERUUID, DEVICELUID, DEVICENODEMASK, DEVICELUIDVALID

        The struct member offsets.
    • Constructor Detail

      • VkPhysicalDeviceIDProperties

        public VkPhysicalDeviceIDProperties​(java.nio.ByteBuffer container)
        Creates a VkPhysicalDeviceIDProperties instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • sType

        public int sType()
        the type of this structure.
      • pNext

        public long pNext()
        NULL or a pointer to a structure extending this structure.
      • deviceUUID

        public java.nio.ByteBuffer deviceUUID()
        
        public byte deviceUUID​(int index)
        
        an array of UUID_SIZE uint8_t values representing a universally unique identifier for the device.
      • driverUUID

        public java.nio.ByteBuffer driverUUID()
        
        public byte driverUUID​(int index)
        
        an array of UUID_SIZE uint8_t values representing a universally unique identifier for the driver build in use by the device.
      • deviceLUID

        public java.nio.ByteBuffer deviceLUID()
        
        public byte deviceLUID​(int index)
        
        an array of LUID_SIZE uint8_t values representing a locally unique identifier for the device.
      • deviceNodeMask

        public int deviceNodeMask()
        a uint32_t bitfield identifying the node within a linked device adapter corresponding to the device.
      • deviceLUIDValid

        public boolean deviceLUIDValid()
        a boolean value that will be TRUE if deviceLUID contains a valid LUID and deviceNodeMask contains a valid node mask, and FALSE if they do not.
      • malloc

        public static VkPhysicalDeviceIDProperties malloc()
        Returns a new VkPhysicalDeviceIDProperties instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkPhysicalDeviceIDProperties calloc()
        Returns a new VkPhysicalDeviceIDProperties instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkPhysicalDeviceIDProperties create()
        Returns a new VkPhysicalDeviceIDProperties instance allocated with BufferUtils.
      • create

        public static VkPhysicalDeviceIDProperties create​(long address)
        Returns a new VkPhysicalDeviceIDProperties instance for the specified memory address.
      • malloc

        public static VkPhysicalDeviceIDProperties malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkPhysicalDeviceIDProperties instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static VkPhysicalDeviceIDProperties calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkPhysicalDeviceIDProperties instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nsType

        public static int nsType​(long struct)
        Unsafe version of sType().
      • npNext

        public static long npNext​(long struct)
        Unsafe version of pNext().
      • ndeviceUUID

        public static java.nio.ByteBuffer ndeviceUUID​(long struct)
        Unsafe version of deviceUUID().
      • ndeviceUUID

        public static byte ndeviceUUID​(long struct,
                                       int index)
        Unsafe version of deviceUUID.
      • ndriverUUID

        public static java.nio.ByteBuffer ndriverUUID​(long struct)
        Unsafe version of driverUUID().
      • ndriverUUID

        public static byte ndriverUUID​(long struct,
                                       int index)
        Unsafe version of driverUUID.
      • ndeviceLUID

        public static java.nio.ByteBuffer ndeviceLUID​(long struct)
        Unsafe version of deviceLUID().
      • ndeviceLUID

        public static byte ndeviceLUID​(long struct,
                                       int index)
        Unsafe version of deviceLUID.
      • ndeviceNodeMask

        public static int ndeviceNodeMask​(long struct)
        Unsafe version of deviceNodeMask().
      • ndeviceLUIDValid

        public static int ndeviceLUIDValid​(long struct)
        Unsafe version of deviceLUIDValid().
      • nsType

        public static void nsType​(long struct,
                                  int value)
        Unsafe version of sType.
      • npNext

        public static void npNext​(long struct,
                                  long value)
        Unsafe version of pNext.