Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class WGLAMDGPUAssociation

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to the WGL_AMD_gpu_association extension.

There currently is no way for applications to efficiently use GPU resources in systems that contain more than one GPU. Vendors have provided methods that attempt to split the workload for an application among the available GPU resources. This has proven to be very inefficient because most applications were never written with these sorts of optimizations in mind.

This extension provides a mechanism for applications to explicitly use the GPU resources on a given system individually. By providing this functionality, a driver allows applications to make appropriate decisions regarding where and when to distribute rendering tasks.

Requires WGL_ARB_extensions_string and EXT_framebuffer_object.

Field Summary

Modifier and TypeField and Description
public static final int
WGL_GPU_CLOCK_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_FASTEST_TARGET_GPUS_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_NUM_PIPES_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_NUM_RB_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_NUM_SIMD_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_NUM_SPI_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_OPENGL_VERSION_STRING_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_RAM_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_RENDERER_STRING_AMD

Accepted by the property parameter of GetGPUInfoAMD.

public static final int
WGL_GPU_VENDOR_AMD

Accepted by the property parameter of GetGPUInfoAMD.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
nwglCreateAssociatedContextAttribsAMD(int id, long shareContext, long attribList)

Unsafe version of: CreateAssociatedContextAttribsAMD

public static int
nwglGetGPUIDsAMD(int
the max number of IDs that can be returned
maxCount
,
long ids)

Unsafe version of: GetGPUIDsAMD

public static int
nwglGetGPUInfoAMD(int id, int property, int dataType, int
the size of the data buffer
size
,
long data)

Unsafe version of: GetGPUInfoAMD

public static void
wglBlitContextFramebufferAMD(long
the context handle for the write context
dstCtx
,
int
the source x0 coordinate
srcX0
,
int
the source Y0 coordinate
srcY0
,
int
the source X1 coordinate
srcX1
,
int
the source Y1 coordinate
srcY1
,
int
the destination X0 coordinate
dstX0
,
int
the destination Y0 coordinate
dstY0
,
int
the destination X1 coordinate
dstX1
,
int
the destination Y1 coordinate
dstY1
,
int
the bitwise OR of a number of values indicating which buffers are to be copied. One or more of:
COLOR_BUFFER_BITDEPTH_BUFFER_BITSTENCIL_BUFFER_BIT
mask
,
int
the interpolation method to apply if the image is stretched. One of:
LINEARNEAREST
filter
)

Blits data from one context to another.

public static long
wglCreateAssociatedContextAMD(int
a valid GPU id
id
)

Creates an associated context.

public static long
wglCreateAssociatedContextAttribsAMD(int
a valid GPU id
id
,
long
must either be NULL or that of an associated context created with the same GPU ID as id
shareContext
,
IntBuffer
a 0-terminated list of attributes for the context
attribList
)

Create an associated context with a specific GL version.

public static long
wglCreateAssociatedContextAttribsAMD(int id, long shareContext, int[] attribList)

Array version of: CreateAssociatedContextAttribsAMD

public static boolean
wglDeleteAssociatedContextAMD(long
a valid associated context created by calling CreateAssociatedContextAMD
hglrc
)

Deletes an associated context.

public static int
wglGetContextGPUIDAMD(long
the context for which the GPU id will be returned
hglrc
)

Determine which GPU a context is attached to.

public static long
wglGetCurrentAssociatedContextAMD()

Returns the current associated context in the current thread.

public static int
wglGetGPUIDsAMD(IntBuffer
the array of returned IDs
ids
)

Returns the IDs for available GPUs.

public static int
wglGetGPUIDsAMD(int[] ids)

Array version of: GetGPUIDsAMD

public static int
wglGetGPUInfoAMD(int
a GPU id obtained from calling GetGPUIDsAMD
id
,
int property, int
the data type to be returned. One of:
UNSIGNED_INTINTFLOATUNSIGNED_BYTE
dataType
,
ByteBuffer
the buffer which will be filled with the requested information
data
)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.

public static int
wglGetGPUInfoAMD(int
a GPU id obtained from calling GetGPUIDsAMD
id
,
int property, int
the data type to be returned. One of:
UNSIGNED_INTINTFLOATUNSIGNED_BYTE
dataType
,
IntBuffer
the buffer which will be filled with the requested information
data
)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.

public static int
wglGetGPUInfoAMD(int
a GPU id obtained from calling GetGPUIDsAMD
id
,
int property, int
the data type to be returned. One of:
UNSIGNED_INTINTFLOATUNSIGNED_BYTE
dataType
,
FloatBuffer
the buffer which will be filled with the requested information
data
)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.

public static int
wglGetGPUInfoAMD(int id, int property, int dataType, int[] data)

Array version of: GetGPUInfoAMD

public static int
wglGetGPUInfoAMD(int id, int property, int dataType, float[] data)

Array version of: GetGPUInfoAMD

public static boolean
wglMakeAssociatedContextCurrentAMD(long
a context handle created by calling CreateAssociatedContextAMD
hglrc
)

Makes an associated context current in the current thread.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

WGL_GPU_CLOCK_AMDback to summary
public static final int WGL_GPU_CLOCK_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_FASTEST_TARGET_GPUS_AMDback to summary
public static final int WGL_GPU_FASTEST_TARGET_GPUS_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_NUM_PIPES_AMDback to summary
public static final int WGL_GPU_NUM_PIPES_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_NUM_RB_AMDback to summary
public static final int WGL_GPU_NUM_RB_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_NUM_SIMD_AMDback to summary
public static final int WGL_GPU_NUM_SIMD_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_NUM_SPI_AMDback to summary
public static final int WGL_GPU_NUM_SPI_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_OPENGL_VERSION_STRING_AMDback to summary
public static final int WGL_GPU_OPENGL_VERSION_STRING_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_RAM_AMDback to summary
public static final int WGL_GPU_RAM_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_RENDERER_STRING_AMDback to summary
public static final int WGL_GPU_RENDERER_STRING_AMD

Accepted by the property parameter of GetGPUInfoAMD.

WGL_GPU_VENDOR_AMDback to summary
public static final int WGL_GPU_VENDOR_AMD

Accepted by the property parameter of GetGPUInfoAMD.

Constructor Detail

WGLAMDGPUAssociationback to summary
protected WGLAMDGPUAssociation()

Method Detail

nwglCreateAssociatedContextAttribsAMDback to summary
public static long nwglCreateAssociatedContextAttribsAMD(int id, long shareContext, long attribList)

Unsafe version of: CreateAssociatedContextAttribsAMD

nwglGetGPUIDsAMDback to summary
public static int nwglGetGPUIDsAMD(int maxCount, long ids)

Unsafe version of: GetGPUIDsAMD

Parameters
maxCount:int

the max number of IDs that can be returned

nwglGetGPUInfoAMDback to summary
public static int nwglGetGPUInfoAMD(int id, int property, int dataType, int size, long data)

Unsafe version of: GetGPUInfoAMD

Parameters
size:int

the size of the data buffer

wglBlitContextFramebufferAMDback to summary
public static void wglBlitContextFramebufferAMD(long dstCtx, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter)

Blits data from one context to another. This facilitates high performance data communication between multiple contexts.

Parameters
dstCtx:long

the context handle for the write context

srcX0:int

the source x0 coordinate

srcY0:int

the source Y0 coordinate

srcX1:int

the source X1 coordinate

srcY1:int

the source Y1 coordinate

dstX0:int

the destination X0 coordinate

dstY0:int

the destination Y0 coordinate

dstX1:int

the destination X1 coordinate

dstY1:int

the destination Y1 coordinate

mask:int

the bitwise OR of a number of values indicating which buffers are to be copied. One or more of:

COLOR_BUFFER_BITDEPTH_BUFFER_BITSTENCIL_BUFFER_BIT
filter:int

the interpolation method to apply if the image is stretched. One of:

LINEARNEAREST
Annotations
@NativeType:VOID
wglCreateAssociatedContextAMDback to summary
public static long wglCreateAssociatedContextAMD(int id)

Creates an associated context. Upon successful creation, no pixel format is tied to an associated context.

Parameters
id:int

a valid GPU id

Annotations
@NativeType:HGLRC
wglCreateAssociatedContextAttribsAMDback to summary
public static long wglCreateAssociatedContextAttribsAMD(int id, long shareContext, IntBuffer attribList)

Create an associated context with a specific GL version.

All capabilities and limitations of CreateContextAttribsARB apply to CreateAssociatedContextAttribsAMD.

Parameters
id:int

a valid GPU id

shareContext:long

must either be NULL or that of an associated context created with the same GPU ID as id

attribList:IntBuffer

a 0-terminated list of attributes for the context

Annotations
@NativeType:HGLRC
wglCreateAssociatedContextAttribsAMDback to summary
public static long wglCreateAssociatedContextAttribsAMD(int id, long shareContext, int[] attribList)

Array version of: CreateAssociatedContextAttribsAMD

Annotations
@NativeType:HGLRC
wglDeleteAssociatedContextAMDback to summary
public static boolean wglDeleteAssociatedContextAMD(long hglrc)

Deletes an associated context. An associated context cannot be deleted by calling DeleteContext.

Parameters
hglrc:long

a valid associated context created by calling CreateAssociatedContextAMD

Annotations
@NativeType:BOOL
wglGetContextGPUIDAMDback to summary
public static int wglGetContextGPUIDAMD(long hglrc)

Determine which GPU a context is attached to.

Unassociated contexts are created by calling CreateContext. Although these contexts are unassociated, their use will still be tied to a single GPU in most cases. For this reason it is advantageous to be able to query the GPU an existing unassociated context resides on. If multiple GPUs are available, it would be undesirable to use one for rendering to visible surfaces and then chose the same one for off-screen rendering.

Parameters
hglrc:long

the context for which the GPU id will be returned

Annotations
@NativeType:UINT
wglGetCurrentAssociatedContextAMDback to summary
public static long wglGetCurrentAssociatedContextAMD()

Returns the current associated context in the current thread.

Annotations
@NativeType:HGLRC
wglGetGPUIDsAMDback to summary
public static int wglGetGPUIDsAMD(IntBuffer ids)

Returns the IDs for available GPUs.

If the function succeeds, the return value is the number of total GPUs available. The value 0 is returned if no GPUs are available or if the call has failed. The ID 0 is reserved and will not be retuned as a valid GPU ID. If the array ids is NULL, the function will only return the total number of GPUs. ids will be tightly packed with no 0 values between valid ids.

Parameters
ids:IntBuffer

the array of returned IDs

Annotations
@NativeType:UINT
wglGetGPUIDsAMDback to summary
public static int wglGetGPUIDsAMD(int[] ids)

Array version of: GetGPUIDsAMD

Annotations
@NativeType:UINT
wglGetGPUInfoAMDback to summary
public static int wglGetGPUInfoAMD(int id, int property, int dataType, ByteBuffer data)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine which GPU is best suited for a specific task.

For a string, size will be the number of characters allocated and will include NULL termination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOAT size will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal to size, the query should be repeated with a larger data buffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will be NULL terminated. If the function fails, -1 will be returned.

Parameters
id:int

a GPU id obtained from calling GetGPUIDsAMD

property:int

the information being queried. One of:

GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMD
GPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMD
GPU_NUM_RB_AMDGPU_NUM_SPI_AMD
dataType:int

the data type to be returned. One of:

UNSIGNED_INTINTFLOATUNSIGNED_BYTE
data:ByteBuffer

the buffer which will be filled with the requested information

wglGetGPUInfoAMDback to summary
public static int wglGetGPUInfoAMD(int id, int property, int dataType, IntBuffer data)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine which GPU is best suited for a specific task.

For a string, size will be the number of characters allocated and will include NULL termination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOAT size will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal to size, the query should be repeated with a larger data buffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will be NULL terminated. If the function fails, -1 will be returned.

Parameters
id:int

a GPU id obtained from calling GetGPUIDsAMD

property:int

the information being queried. One of:

GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMD
GPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMD
GPU_NUM_RB_AMDGPU_NUM_SPI_AMD
dataType:int

the data type to be returned. One of:

UNSIGNED_INTINTFLOATUNSIGNED_BYTE
data:IntBuffer

the buffer which will be filled with the requested information

wglGetGPUInfoAMDback to summary
public static int wglGetGPUInfoAMD(int id, int property, int dataType, FloatBuffer data)

Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine which GPU is best suited for a specific task.

For a string, size will be the number of characters allocated and will include NULL termination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOAT size will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal to size, the query should be repeated with a larger data buffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will be NULL terminated. If the function fails, -1 will be returned.

Parameters
id:int

a GPU id obtained from calling GetGPUIDsAMD

property:int

the information being queried. One of:

GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMD
GPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMD
GPU_NUM_RB_AMDGPU_NUM_SPI_AMD
dataType:int

the data type to be returned. One of:

UNSIGNED_INTINTFLOATUNSIGNED_BYTE
data:FloatBuffer

the buffer which will be filled with the requested information

wglGetGPUInfoAMDback to summary
public static int wglGetGPUInfoAMD(int id, int property, int dataType, int[] data)

Array version of: GetGPUInfoAMD

wglGetGPUInfoAMDback to summary
public static int wglGetGPUInfoAMD(int id, int property, int dataType, float[] data)

Array version of: GetGPUInfoAMD

wglMakeAssociatedContextCurrentAMDback to summary
public static boolean wglMakeAssociatedContextCurrentAMD(long hglrc)

Makes an associated context current in the current thread.

Parameters
hglrc:long

a context handle created by calling CreateAssociatedContextAMD

Annotations
@NativeType:BOOL