Class DxgiUtilJNA

java.lang.Object
oshi.util.gpu.DxgiUtilJNA

@ThreadSafe public final class DxgiUtilJNA extends Object
Utility methods for DXGI adapter enumeration and matching on Windows.
  • Method Summary

    Modifier and Type
    Method
    Description
    static oshi.driver.common.windows.gpu.DxgiAdapterInfo
    findMatch(List<oshi.driver.common.windows.gpu.DxgiAdapterInfo> adapters, int vendorId, int deviceId, String adapterName)
    Finds the best-matching DXGI adapter for a given vendor ID, device ID, and adapter name.
    static String
    Normalizes an adapter name for fuzzy matching.
    static List<oshi.driver.common.windows.gpu.DxgiAdapterInfo>
    Enumerates all DXGI display adapters and returns their identity and dedicated video memory.
    static long
    Converts a registry value to a VRAM size in bytes.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • queryAdapters

      public static List<oshi.driver.common.windows.gpu.DxgiAdapterInfo> queryAdapters()
      Enumerates all DXGI display adapters and returns their identity and dedicated video memory.
      Returns:
      list of DxgiAdapterInfo, one per adapter; empty if DXGI is unavailable
    • findMatch

      public static oshi.driver.common.windows.gpu.DxgiAdapterInfo findMatch(List<oshi.driver.common.windows.gpu.DxgiAdapterInfo> adapters, int vendorId, int deviceId, String adapterName)
      Finds the best-matching DXGI adapter for a given vendor ID, device ID, and adapter name.
      Parameters:
      adapters - list from queryAdapters()
      vendorId - PCI vendor ID parsed from the registry key (0 if unknown)
      deviceId - PCI device ID parsed from the registry key (0 if unknown)
      adapterName - adapter name from the registry DriverDesc value
      Returns:
      best-matching adapter, or null
    • registryValueToVram

      public static long registryValueToVram(Object value)
      Converts a registry value to a VRAM size in bytes.
      Parameters:
      value - the registry value object
      Returns:
      the VRAM size in bytes, or 0 if the value type is unrecognised
    • normalizeName

      public static String normalizeName(String name)
      Normalizes an adapter name for fuzzy matching.
      Parameters:
      name - the raw adapter name, may be null
      Returns:
      normalized name, never null