Class WGLNVGPUAffinity


  • public class WGLNVGPUAffinity
    extends java.lang.Object
    Native bindings to the WGL_NV_gpu_affinity extension.

    On systems with more than one GPU it is desirable to be able to select which GPU(s) in the system become the target for OpenGL rendering commands. This extension introduces the concept of a GPU affinity mask. OpenGL rendering commands are directed to the GPU(s) specified by the affinity mask. GPU affinity is immutable. Once set, it cannot be changed.

    This extension also introduces the concept called affinity-DC. An affinity-DC is a device context with a GPU affinity mask embedded in it. This restricts the device context to only allow OpenGL commands to be sent to the GPU(s) in the affinity mask.

    Requires WGL_ARB_extensions_string.

    • Method Detail

      • nwglEnumGpusNV

        public static int nwglEnumGpusNV​(int gpuIndex,
                                         long gpu)
        Unsafe version of: EnumGpusNV
      • wglEnumGpusNV

        public static boolean wglEnumGpusNV​(int gpuIndex,
                                            PointerBuffer gpu)
        Returns the handles for all GPUs in a system.

        By looping over wglEnumGpusNV and incrementing gpuIndex, starting at index 0, all GPU handles can be queried. If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE and gpu will be unmodified. The function fails if gpuIndex is greater or equal than the number of GPUs supported by the system.

        Parameters:
        gpuIndex - an index value that specifies a GPU
        gpu - returns a handle for GPU number gpuIndex. The first GPU will be index 0.
      • nwglEnumGpuDevicesNV

        public static int nwglEnumGpuDevicesNV​(long gpu,
                                               int deviceIndex,
                                               long gpuDevice)
        Unsafe version of: EnumGpuDevicesNV
      • wglEnumGpuDevicesNV

        public static boolean wglEnumGpuDevicesNV​(long gpu,
                                                  int deviceIndex,
                                                  GPU_DEVICE gpuDevice)
        Retrieve information about the display devices supported by a GPU.
        Parameters:
        gpu - a handle to the GPU to query
        deviceIndex - an index value that specifies a display device, supported by gpu, to query. The first display device will be index 0.
        gpuDevice - a GPU_DEVICE structure which will receive information about the display device at index deviceIndex.
      • nwglCreateAffinityDCNV

        public static long nwglCreateAffinityDCNV​(long gpuList)
        Unsafe version of: CreateAffinityDCNV
      • wglCreateAffinityDCNV

        public static long wglCreateAffinityDCNV​(PointerBuffer gpuList)
        Creates an affinity-DC. Affinity-DCs, a new type of DC, can be used to direct OpenGL commands to a specific GPU or set of GPUs. An affinity-DC is a device context with a GPU affinity mask embedded in it. This restricts the device context to only allow OpenGL commands to be sent to the GPU(s) in the affinity mask. An affinity-DC can be created directly, using the new function wglCreateAffinityDCNV and also indirectly by calling CreatePbufferARB followed by GetPbufferDCARB.

        If successful, the function returns an affinity-DC handle. If it fails, NULL will be returned.

        Parameters:
        gpuList - a NULL-terminated array of GPU handles to which the affinity-DC will be restricted
      • nwglEnumGpusFromAffinityDCNV

        public static int nwglEnumGpusFromAffinityDCNV​(long affinityDC,
                                                       int gpuIndex,
                                                       long gpu)
        Unsafe version of: EnumGpusFromAffinityDCNV
      • wglEnumGpusFromAffinityDCNV

        public static boolean wglEnumGpusFromAffinityDCNV​(long affinityDC,
                                                          int gpuIndex,
                                                          PointerBuffer gpu)
        Retrieves a list of GPU handles that make up the affinity-mask of an affinity-DC.

        By looping over wglEnumGpusFromAffinityDCNV and incrementing gpuIndex, starting at index 0, all GPU handles associated with the DC can be queried. If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE and gpu will be unmodified. The function fails if gpuIndex is greater or equal than the number of GPUs associated with affinityDC.

        Parameters:
        affinityDC - a handle of the affinity-DC to query
        gpuIndex - an index value of the GPU handle in the affinity mask of affinityDC to query
        gpu - returns a handle for GPU number gpuIndex. The first GPU will be at index 0.
      • wglDeleteDCNV

        public static boolean wglDeleteDCNV​(long hdc)
        Deletes an affinity-DC.
        Parameters:
        hdc - a handle of an affinity-DC to delete