Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class WGLNVGPUAffinity

extends Object
Class Inheritance
Imports
org.lwjgl.*, org.lwjgl.system.*

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

Modifier and TypeField and Description
public static final int
ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV

New error code set by wglShareLists, wglMakeCurrent and MakeContextCurrentARB.

public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
nwglCreateAffinityDCNV(long gpuList)

Unsafe version of: CreateAffinityDCNV

public static int
nwglEnumGpuDevicesNV(long gpu, int deviceIndex, long gpuDevice)

Unsafe version of: EnumGpuDevicesNV

public static int
nwglEnumGpusFromAffinityDCNV(long affinityDC, int gpuIndex, long gpu)

Unsafe version of: EnumGpusFromAffinityDCNV

public static int
nwglEnumGpusNV(int gpuIndex, long gpu)

Unsafe version of: EnumGpusNV

public static long
wglCreateAffinityDCNV(PointerBuffer
a NULL-terminated array of GPU handles to which the affinity-DC will be restricted
gpuList
)

Creates an affinity-DC.

public static boolean
wglDeleteDCNV(long
a handle of an affinity-DC to delete
hdc
)

Deletes an affinity-DC.

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

Retrieve information about the display devices supported by a GPU.

public static boolean
wglEnumGpusFromAffinityDCNV(long
a handle of the affinity-DC to query
affinityDC
,
int
an index value of the GPU handle in the affinity mask of affinityDC to query
gpuIndex
,
PointerBuffer
returns a handle for GPU number gpuIndex. The first GPU will be at index 0.
gpu
)

Retrieves a list of GPU handles that make up the affinity-mask of an affinity-DC.

public static boolean
wglEnumGpusNV(int
an index value that specifies a GPU
gpuIndex
,
PointerBuffer
returns a handle for GPU number gpuIndex. The first GPU will be index 0.
gpu
)

Returns the handles for all GPUs in a system.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ERROR_INCOMPATIBLE_AFFINITY_MASKS_NVback to summary
public static final int ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV

New error code set by wglShareLists, wglMakeCurrent and MakeContextCurrentARB.

ERROR_MISSING_AFFINITY_MASK_NVback to summary
public static final int ERROR_MISSING_AFFINITY_MASK_NV

New error code set by MakeCurrent and MakeContextCurrentARB.

Constructor Detail

WGLNVGPUAffinityback to summary
protected WGLNVGPUAffinity()

Method Detail

nwglCreateAffinityDCNVback to summary
public static long nwglCreateAffinityDCNV(long gpuList)

Unsafe version of: CreateAffinityDCNV

nwglEnumGpuDevicesNVback to summary
public static int nwglEnumGpuDevicesNV(long gpu, int deviceIndex, long gpuDevice)

Unsafe version of: EnumGpuDevicesNV

nwglEnumGpusFromAffinityDCNVback to summary
public static int nwglEnumGpusFromAffinityDCNV(long affinityDC, int gpuIndex, long gpu)

Unsafe version of: EnumGpusFromAffinityDCNV

nwglEnumGpusNVback to summary
public static int nwglEnumGpusNV(int gpuIndex, long gpu)

Unsafe version of: EnumGpusNV

wglCreateAffinityDCNVback to summary
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:PointerBuffer

a NULL-terminated array of GPU handles to which the affinity-DC will be restricted

Annotations
@NativeType:HDC
wglDeleteDCNVback to summary
public static boolean wglDeleteDCNV(long hdc)

Deletes an affinity-DC.

Parameters
hdc:long

a handle of an affinity-DC to delete

Annotations
@NativeType:BOOL
wglEnumGpuDevicesNVback to summary
public static boolean wglEnumGpuDevicesNV(long gpu, int deviceIndex, GPU_DEVICE gpuDevice)

Retrieve information about the display devices supported by a GPU.

Parameters
gpu:long

a handle to the GPU to query

deviceIndex:int

an index value that specifies a display device, supported by gpu, to query. The first display device will be index 0.

gpuDevice:GPU_DEVICE

a GPU_DEVICE structure which will receive information about the display device at index deviceIndex.

Annotations
@NativeType:BOOL
wglEnumGpusFromAffinityDCNVback to summary
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:long

a handle of the affinity-DC to query

gpuIndex:int

an index value of the GPU handle in the affinity mask of affinityDC to query

gpu:PointerBuffer

returns a handle for GPU number gpuIndex. The first GPU will be at index 0.

Annotations
@NativeType:BOOL
wglEnumGpusNVback to summary
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:int

an index value that specifies a GPU

gpu:PointerBuffer

returns a handle for GPU number gpuIndex. The first GPU will be index 0.

Annotations
@NativeType:BOOL