Class WGLNVGPUAffinity
- java.lang.Object
-
- org.lwjgl.opengl.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
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV
New error code set by wglShareLists, wglMakeCurrent andMakeContextCurrentARB
.static int
ERROR_MISSING_AFFINITY_MASK_NV
New error code set byMakeCurrent
andMakeContextCurrentARB
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static long
wglCreateAffinityDCNV(org.lwjgl.PointerBuffer gpuList)
Creates an affinity-DC.static boolean
wglDeleteDCNV(long hdc)
Deletes an affinity-DC.static boolean
wglEnumGpuDevicesNV(long gpu, int deviceIndex, GPU_DEVICE gpuDevice)
Retrieve information about the display devices supported by a GPU.static boolean
wglEnumGpusFromAffinityDCNV(long affinityDC, int gpuIndex, org.lwjgl.PointerBuffer gpu)
Retrieves a list of GPU handles that make up the affinity-mask of an affinity-DC.static boolean
wglEnumGpusNV(int gpuIndex, org.lwjgl.PointerBuffer gpu)
Returns the handles for all GPUs in a system.
-
-
-
Field Detail
-
ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV
public static final int ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV
New error code set by wglShareLists, wglMakeCurrent andMakeContextCurrentARB
.- See Also:
- Constant Field Values
-
ERROR_MISSING_AFFINITY_MASK_NV
public static final int ERROR_MISSING_AFFINITY_MASK_NV
New error code set byMakeCurrent
andMakeContextCurrentARB
.- See Also:
- Constant Field Values
-
-
Method Detail
-
wglEnumGpusNV
public static boolean wglEnumGpusNV(int gpuIndex, org.lwjgl.PointerBuffer gpu)
Returns the handles for all GPUs in a system.By looping over
wglEnumGpusNV
and incrementinggpuIndex
, 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 andgpu
will be unmodified. The function fails ifgpuIndex
is greater or equal than the number of GPUs supported by the system.- Parameters:
gpuIndex
- an index value that specifies a GPUgpu
- returns a handle for GPU numbergpuIndex
. The first GPU will be index 0.
-
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 querydeviceIndex
- an index value that specifies a display device, supported bygpu
, to query. The first display device will be index 0.gpuDevice
- aGPU_DEVICE
structure which will receive information about the display device at indexdeviceIndex
.
-
wglCreateAffinityDCNV
public static long wglCreateAffinityDCNV(org.lwjgl.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 functionwglCreateAffinityDCNV
and also indirectly by callingCreatePbufferARB
followed byGetPbufferDCARB
.If successful, the function returns an affinity-DC handle. If it fails,
NULL
will be returned.- Parameters:
gpuList
- aNULL
-terminated array of GPU handles to which the affinity-DC will be restricted
-
wglEnumGpusFromAffinityDCNV
public static boolean wglEnumGpusFromAffinityDCNV(long affinityDC, int gpuIndex, org.lwjgl.PointerBuffer gpu)
Retrieves a list of GPU handles that make up the affinity-mask of an affinity-DC.By looping over
wglEnumGpusFromAffinityDCNV
and incrementinggpuIndex
, 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 andgpu
will be unmodified. The function fails ifgpuIndex
is greater or equal than the number of GPUs associated withaffinityDC
.- Parameters:
affinityDC
- a handle of the affinity-DC to querygpuIndex
- an index value of the GPU handle in the affinity mask ofaffinityDC
to querygpu
- returns a handle for GPU numbergpuIndex
. 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
-
-