Class WGLAMDGPUAssociation
- java.lang.Object
-
- org.lwjgl.opengl.WGLAMDGPUAssociation
-
public class WGLAMDGPUAssociation extends java.lang.ObjectNative 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_stringand EXT_framebuffer_object.
-
-
Field Summary
Fields Modifier and Type Field and Description static intWGL_GPU_CLOCK_AMD
WGL_GPU_FASTEST_TARGET_GPUS_AMD
WGL_GPU_NUM_PIPES_AMD
WGL_GPU_NUM_RB_AMD
WGL_GPU_NUM_SIMD_AMD
WGL_GPU_NUM_SPI_AMD
WGL_GPU_OPENGL_VERSION_STRING_AMD
WGL_GPU_RAM_AMD
WGL_GPU_RENDERER_STRING_AMD
WGL_GPU_VENDOR_AMDAccepted by thepropertyparameter ofGetGPUInfoAMD.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static 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, java.nio.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 longwglGetCurrentAssociatedContextAMD()Returns the current associated context in the current thread.static intwglGetGPUIDsAMD(int[] ids)Array version of:GetGPUIDsAMDstatic intwglGetGPUIDsAMD(java.nio.IntBuffer ids)Returns the IDs for available GPUs.static intwglGetGPUInfoAMD(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 intwglGetGPUInfoAMD(int id, int property, int dataType, float[] data)Array version of:GetGPUInfoAMDstatic intwglGetGPUInfoAMD(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 intwglGetGPUInfoAMD(int id, int property, int dataType, int[] data)Array version of:GetGPUInfoAMDstatic intwglGetGPUInfoAMD(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 booleanwglMakeAssociatedContextCurrentAMD(long hglrc)Makes an associated context current in the current thread.
-
-
-
Field Detail
-
WGL_GPU_VENDOR_AMD, WGL_GPU_RENDERER_STRING_AMD, WGL_GPU_OPENGL_VERSION_STRING_AMD, WGL_GPU_FASTEST_TARGET_GPUS_AMD, WGL_GPU_RAM_AMD, WGL_GPU_CLOCK_AMD, WGL_GPU_NUM_PIPES_AMD, WGL_GPU_NUM_SIMD_AMD, WGL_GPU_NUM_RB_AMD, WGL_GPU_NUM_SPI_AMD
Accepted by thepropertyparameter ofGetGPUInfoAMD.
-
-
Method Detail
-
wglGetGPUIDsAMD
public static int wglGetGPUIDsAMD(java.nio.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
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
-
wglGetGPUInfoAMD
public static int wglGetGPUInfoAMD(int id, int property, int dataType, java.nio.ByteBuffer data) public static int wglGetGPUInfoAMD(int id, int property, int dataType, java.nio.IntBuffer data) public 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. 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
-
wglCreateAssociatedContextAttribsAMD
public static long wglCreateAssociatedContextAttribsAMD(int id, long shareContext, java.nio.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(int[] ids)
Array version of:GetGPUIDsAMD
-
wglGetGPUInfoAMD
public static int wglGetGPUInfoAMD(int id, int property, int dataType, int[] data) 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, int[] attribList)Array version of:CreateAssociatedContextAttribsAMD
-
-