public class WGLAMDGPUAssociation
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
static int |
WGL_GPU_CLOCK_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_FASTEST_TARGET_GPUS_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_NUM_PIPES_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_NUM_RB_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_NUM_SIMD_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_NUM_SPI_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_OPENGL_VERSION_STRING_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_RAM_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_RENDERER_STRING_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
static int |
WGL_GPU_VENDOR_AMD
Accepted by the
property parameter of GetGPUInfoAMD. |
| Modifier and Type | Method and Description |
|---|---|
static long |
nwglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
long attribList)
Unsafe version of:
CreateAssociatedContextAttribsAMD |
static int |
nwglGetGPUIDsAMD(int maxCount,
long ids)
Unsafe version of:
GetGPUIDsAMD |
static int |
nwglGetGPUInfoAMD(int id,
int property,
int dataType,
int size,
long data)
Unsafe version of:
GetGPUInfoAMD |
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.
|
static long |
wglCreateAssociatedContextAMD(int id)
Creates an associated context.
|
static long |
wglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
int[] attribList)
Array version of:
CreateAssociatedContextAttribsAMD |
static long |
wglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
java.nio.IntBuffer attribList)
Create an associated context with a specific GL version.
|
static boolean |
wglDeleteAssociatedContextAMD(long hglrc)
Deletes an associated context.
|
static int |
wglGetContextGPUIDAMD(long hglrc)
Determine which GPU a context is attached to.
|
static long |
wglGetCurrentAssociatedContextAMD()
Returns the current associated context in the current thread.
|
static int |
wglGetGPUIDsAMD(int[] ids)
Array version of:
GetGPUIDsAMD |
static int |
wglGetGPUIDsAMD(java.nio.IntBuffer ids)
Returns the IDs for available GPUs.
|
static int |
wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.ByteBuffer data)
Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.
|
static int |
wglGetGPUInfoAMD(int id,
int property,
int dataType,
float[] data)
Array version of:
GetGPUInfoAMD |
static int |
wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.FloatBuffer data)
Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.
|
static int |
wglGetGPUInfoAMD(int id,
int property,
int dataType,
int[] data)
Array version of:
GetGPUInfoAMD |
static int |
wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.IntBuffer data)
Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.
|
static boolean |
wglMakeAssociatedContextCurrentAMD(long hglrc)
Makes an associated context current in the current thread.
|
public static final int WGL_GPU_VENDOR_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_RENDERER_STRING_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_OPENGL_VERSION_STRING_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_FASTEST_TARGET_GPUS_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_RAM_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_CLOCK_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_NUM_PIPES_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_NUM_SIMD_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_NUM_RB_AMD
property parameter of GetGPUInfoAMD.public static final int WGL_GPU_NUM_SPI_AMD
property parameter of GetGPUInfoAMD.public static int nwglGetGPUIDsAMD(int maxCount,
long ids)
GetGPUIDsAMDmaxCount - the max number of IDs that can be returnedpublic static int wglGetGPUIDsAMD(@Nullable
java.nio.IntBuffer ids)
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.
ids - the array of returned IDspublic static int nwglGetGPUInfoAMD(int id,
int property,
int dataType,
int size,
long data)
GetGPUInfoAMDsize - the size of the data bufferpublic static int wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.ByteBuffer data)
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.
id - a GPU id obtained from calling GetGPUIDsAMDproperty - the information being queried. One of:GPU_VENDOR_AMD | GPU_RENDERER_STRING_AMD | GPU_OPENGL_VERSION_STRING_AMD | GPU_FASTEST_TARGET_GPUS_AMD |
GPU_RAM_AMD | GPU_CLOCK_AMD | GPU_NUM_PIPES_AMD | GPU_NUM_SIMD_AMD |
GPU_NUM_RB_AMD | GPU_NUM_SPI_AMD |
dataType - the data type to be returned. One of:UNSIGNED_INT | INT | FLOAT | UNSIGNED_BYTE |
data - the buffer which will be filled with the requested informationpublic static int wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.IntBuffer data)
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.
id - a GPU id obtained from calling GetGPUIDsAMDproperty - the information being queried. One of:GPU_VENDOR_AMD | GPU_RENDERER_STRING_AMD | GPU_OPENGL_VERSION_STRING_AMD | GPU_FASTEST_TARGET_GPUS_AMD |
GPU_RAM_AMD | GPU_CLOCK_AMD | GPU_NUM_PIPES_AMD | GPU_NUM_SIMD_AMD |
GPU_NUM_RB_AMD | GPU_NUM_SPI_AMD |
dataType - the data type to be returned. One of:UNSIGNED_INT | INT | FLOAT | UNSIGNED_BYTE |
data - the buffer which will be filled with the requested informationpublic static int wglGetGPUInfoAMD(int id,
int property,
int dataType,
java.nio.FloatBuffer data)
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.
id - a GPU id obtained from calling GetGPUIDsAMDproperty - the information being queried. One of:GPU_VENDOR_AMD | GPU_RENDERER_STRING_AMD | GPU_OPENGL_VERSION_STRING_AMD | GPU_FASTEST_TARGET_GPUS_AMD |
GPU_RAM_AMD | GPU_CLOCK_AMD | GPU_NUM_PIPES_AMD | GPU_NUM_SIMD_AMD |
GPU_NUM_RB_AMD | GPU_NUM_SPI_AMD |
dataType - the data type to be returned. One of:UNSIGNED_INT | INT | FLOAT | UNSIGNED_BYTE |
data - the buffer which will be filled with the requested informationpublic static int wglGetContextGPUIDAMD(long hglrc)
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.
hglrc - the context for which the GPU id will be returnedpublic static long wglCreateAssociatedContextAMD(int id)
id - a valid GPU idpublic static long nwglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
long attribList)
CreateAssociatedContextAttribsAMDpublic static long wglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
@Nullable
java.nio.IntBuffer attribList)
All capabilities and limitations of CreateContextAttribsARB apply to CreateAssociatedContextAttribsAMD.
id - a valid GPU idshareContext - must either be NULL or that of an associated context created with the same GPU ID as idattribList - a 0-terminated list of attributes for the contextpublic static boolean wglDeleteAssociatedContextAMD(long hglrc)
DeleteContext.hglrc - a valid associated context created by calling CreateAssociatedContextAMDpublic static boolean wglMakeAssociatedContextCurrentAMD(long hglrc)
hglrc - a context handle created by calling CreateAssociatedContextAMDpublic static long wglGetCurrentAssociatedContextAMD()
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)
dstCtx - the context handle for the write contextsrcX0 - the source x0 coordinatesrcY0 - the source Y0 coordinatesrcX1 - the source X1 coordinatesrcY1 - the source Y1 coordinatedstX0 - the destination X0 coordinatedstY0 - the destination Y0 coordinatedstX1 - the destination X1 coordinatedstY1 - the destination Y1 coordinatemask - the bitwise OR of a number of values indicating which buffers are to be copied. One or more of:COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT | STENCIL_BUFFER_BIT |
filter - the interpolation method to apply if the image is stretched. One of:LINEAR | NEAREST |
public static int wglGetGPUIDsAMD(@Nullable
int[] ids)
GetGPUIDsAMDpublic static int wglGetGPUInfoAMD(int id,
int property,
int dataType,
int[] data)
GetGPUInfoAMDpublic static int wglGetGPUInfoAMD(int id,
int property,
int dataType,
float[] data)
GetGPUInfoAMDpublic static long wglCreateAssociatedContextAttribsAMD(int id,
long shareContext,
@Nullable
int[] attribList)
CreateAssociatedContextAttribsAMDCopyright LWJGL. All Rights Reserved. License terms.