Class WGLAMDGPUAssociation
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
FieldsModifier and TypeFieldDescriptionstatic final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD.static final intAccepted by thepropertyparameter ofGetGPUInfoAMD. -
Method Summary
Modifier and TypeMethodDescriptionstatic longnwglCreateAssociatedContextAttribsAMD(int id, long shareContext, long attribList) Unsafe version of:CreateAssociatedContextAttribsAMDstatic intnwglGetGPUIDsAMD(int maxCount, long ids) Unsafe version of:GetGPUIDsAMDstatic intnwglGetGPUInfoAMD(int id, int property, int dataType, int size, long data) Unsafe version of:GetGPUInfoAMDstatic voidwglBlitContextFramebufferAMD(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 longwglCreateAssociatedContextAMD(int id) Creates an associated context.static longwglCreateAssociatedContextAttribsAMD(int id, long shareContext, int[] attribList) Array version of:CreateAssociatedContextAttribsAMDstatic longwglCreateAssociatedContextAttribsAMD(int id, long shareContext, IntBuffer attribList) Create an associated context with a specific GL version.static booleanwglDeleteAssociatedContextAMD(long hglrc) Deletes an associated context.static intwglGetContextGPUIDAMD(long hglrc) Determine which GPU a context is attached to.static longReturns the current associated context in the current thread.static intwglGetGPUIDsAMD(int[] ids) Array version of:GetGPUIDsAMDstatic intwglGetGPUIDsAMD(IntBuffer ids) Returns the IDs for available GPUs.static intwglGetGPUInfoAMD(int id, int property, int dataType, float[] data) Array version of:GetGPUInfoAMDstatic intwglGetGPUInfoAMD(int id, int property, int dataType, int[] data) Array version of:GetGPUInfoAMDstatic intwglGetGPUInfoAMD(int id, int property, int dataType, ByteBuffer data) Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.static intwglGetGPUInfoAMD(int id, int property, int dataType, FloatBuffer data) Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.static intwglGetGPUInfoAMD(int id, int property, int dataType, IntBuffer data) Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions.static booleanwglMakeAssociatedContextCurrentAMD(long hglrc) Makes an associated context current in the current thread.
-
Field Details
-
WGL_GPU_VENDOR_AMD
public static final int WGL_GPU_VENDOR_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_RENDERER_STRING_AMD
public static final int WGL_GPU_RENDERER_STRING_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_OPENGL_VERSION_STRING_AMD
public static final int WGL_GPU_OPENGL_VERSION_STRING_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_FASTEST_TARGET_GPUS_AMD
public static final int WGL_GPU_FASTEST_TARGET_GPUS_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_RAM_AMD
public static final int WGL_GPU_RAM_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_CLOCK_AMD
public static final int WGL_GPU_CLOCK_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_NUM_PIPES_AMD
public static final int WGL_GPU_NUM_PIPES_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_NUM_SIMD_AMD
public static final int WGL_GPU_NUM_SIMD_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_NUM_RB_AMD
public static final int WGL_GPU_NUM_RB_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
WGL_GPU_NUM_SPI_AMD
public static final int WGL_GPU_NUM_SPI_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.- See Also:
-
-
Method Details
-
nwglGetGPUIDsAMD
public static int nwglGetGPUIDsAMD(int maxCount, long ids) Unsafe version of:GetGPUIDsAMD- Parameters:
maxCount- the max number of IDs that can be returned
-
wglGetGPUIDsAMD
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
idsisNULL, the function will only return the total number of GPUs.idswill be tightly packed with no 0 values between valid ids.- Parameters:
ids- the array of returned IDs
-
nwglGetGPUInfoAMD
public static int nwglGetGPUInfoAMD(int id, int property, int dataType, int size, long data) Unsafe version of:GetGPUInfoAMD- Parameters:
size- the size of thedatabuffer
-
wglGetGPUInfoAMD
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,
sizewill be the number of characters allocated and will includeNULLtermination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOATsizewill be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal tosize, the query should be repeated with a largerdatabuffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will beNULLterminated. If the function fails, -1 will be returned.- Parameters:
id- a GPU id obtained from callingGetGPUIDsAMDproperty- the information being queried. One of:GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMDGPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMDGPU_NUM_RB_AMDGPU_NUM_SPI_AMDdataType- the data type to be returned. One of:UNSIGNED_INTINTFLOATUNSIGNED_BYTEdata- the buffer which will be filled with the requested information
-
wglGetGPUInfoAMD
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,
sizewill be the number of characters allocated and will includeNULLtermination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOATsizewill be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal tosize, the query should be repeated with a largerdatabuffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will beNULLterminated. If the function fails, -1 will be returned.- Parameters:
id- a GPU id obtained from callingGetGPUIDsAMDproperty- the information being queried. One of:GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMDGPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMDGPU_NUM_RB_AMDGPU_NUM_SPI_AMDdataType- the data type to be returned. One of:UNSIGNED_INTINTFLOATUNSIGNED_BYTEdata- the buffer which will be filled with the requested information
-
wglGetGPUInfoAMD
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,
sizewill be the number of characters allocated and will includeNULLtermination. For arrays of type GL_UNSIGNED_INT, GL_INT, and GL_FLOATsizewill be the array depth. If the function succeeds, the number of values written will be returned. If the number of values written is equal tosize, the query should be repeated with a largerdatabuffer. Strings should be queried using the GL_UNSIGNED_BYTE type, are UTF-8 encoded and will beNULLterminated. If the function fails, -1 will be returned.- Parameters:
id- a GPU id obtained from callingGetGPUIDsAMDproperty- the information being queried. One of:GPU_VENDOR_AMDGPU_RENDERER_STRING_AMDGPU_OPENGL_VERSION_STRING_AMDGPU_FASTEST_TARGET_GPUS_AMDGPU_RAM_AMDGPU_CLOCK_AMDGPU_NUM_PIPES_AMDGPU_NUM_SIMD_AMDGPU_NUM_RB_AMDGPU_NUM_SPI_AMDdataType- the data type to be returned. One of:UNSIGNED_INTINTFLOATUNSIGNED_BYTEdata- the buffer which will be filled with the requested information
-
wglGetContextGPUIDAMD
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- the context for which the GPU id will be returned
-
wglCreateAssociatedContextAMD
public static long wglCreateAssociatedContextAMD(int id) Creates an associated context. Upon successful creation, no pixel format is tied to an associated context.- Parameters:
id- a valid GPU id
-
nwglCreateAssociatedContextAttribsAMD
public static long nwglCreateAssociatedContextAttribsAMD(int id, long shareContext, long attribList) Unsafe version of:CreateAssociatedContextAttribsAMD -
wglCreateAssociatedContextAttribsAMD
public static long wglCreateAssociatedContextAttribsAMD(int id, long shareContext, @Nullable IntBuffer attribList) Create an associated context with a specific GL version.All capabilities and limitations of
CreateContextAttribsARBapply toCreateAssociatedContextAttribsAMD.- Parameters:
id- a valid GPU idshareContext- must either beNULLor that of an associated context created with the same GPU ID asidattribList- a 0-terminated list of attributes for the context
-
wglDeleteAssociatedContextAMD
public static boolean wglDeleteAssociatedContextAMD(long hglrc) Deletes an associated context. An associated context cannot be deleted by callingDeleteContext.- Parameters:
hglrc- a valid associated context created by callingCreateAssociatedContextAMD
-
wglMakeAssociatedContextCurrentAMD
public static boolean wglMakeAssociatedContextCurrentAMD(long hglrc) Makes an associated context current in the current thread.- Parameters:
hglrc- a context handle created by callingCreateAssociatedContextAMD
-
wglGetCurrentAssociatedContextAMD
public static long wglGetCurrentAssociatedContextAMD()Returns the current associated context in the current thread. -
wglBlitContextFramebufferAMD
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- 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_BITDEPTH_BUFFER_BITSTENCIL_BUFFER_BITfilter- the interpolation method to apply if the image is stretched. One of:LINEARNEAREST
-
wglGetGPUIDsAMD
public static int wglGetGPUIDsAMD(@Nullable int[] ids) Array version of:GetGPUIDsAMD -
wglGetGPUInfoAMD
public static int wglGetGPUInfoAMD(int id, int property, int dataType, int[] data) Array version of:GetGPUInfoAMD -
wglGetGPUInfoAMD
public static int wglGetGPUInfoAMD(int id, int property, int dataType, float[] data) Array version of:GetGPUInfoAMD -
wglCreateAssociatedContextAttribsAMD
public static long wglCreateAssociatedContextAttribsAMD(int id, long shareContext, @Nullable int[] attribList) Array version of:CreateAssociatedContextAttribsAMD
-