Class KHRGLSharing
- java.lang.Object
-
- org.lwjgl.opencl.KHRGLSharing
-
public class KHRGLSharing extends java.lang.ObjectNative bindings to the khr_gl_sharing extension.
-
-
Field Summary
Fields Modifier and Type Field and Description static intCL_CGL_SHAREGROUP_KHRAccepted as an attribute name in thepropertiesargument ofCreateContextandCreateContextFromType.static intCL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
CL_DEVICES_FOR_GL_CONTEXT_KHRAccepted as theparam_nameargument ofGetGLContextInfoKHR.static intCL_EGL_DISPLAY_KHR
CL_GL_CONTEXT_KHR
CL_GLX_DISPLAY_KHRAccepted as an attribute name in thepropertiesargument ofCreateContextandCreateContextFromType.static intCL_INVALID_GL_SHAREGROUP_REFERENCE_KHRReturned byCreateContext,CreateContextFromType, andGetGLContextInfoKHRwhen an invalid OpenGL context or share group object handle is specified inproperties.static intCL_WGL_HDC_KHRAccepted as an attribute name in thepropertiesargument ofCreateContextandCreateContextFromType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intclGetGLContextInfoKHR(org.lwjgl.PointerBuffer properties, int param_name, java.nio.ByteBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)Queries the OpenCL device currently corresponding to an OpenGL context.static intclGetGLContextInfoKHR(org.lwjgl.PointerBuffer properties, int param_name, org.lwjgl.PointerBuffer param_value, org.lwjgl.PointerBuffer param_value_size_ret)Queries the OpenCL device currently corresponding to an OpenGL context.
-
-
-
Field Detail
-
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR
Returned byCreateContext,CreateContextFromType, andGetGLContextInfoKHRwhen an invalid OpenGL context or share group object handle is specified inproperties.
-
CL_DEVICES_FOR_GL_CONTEXT_KHR
Accepted as theparam_nameargument ofGetGLContextInfoKHR. Returns a list of all CL devices which may be associated with the specified OpenGL context.
-
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
Accepted as theparam_nameargument ofGetGLContextInfoKHR. Returns the CL device currently associated with the specified OpenGL context.
-
CL_GL_CONTEXT_KHR, CL_EGL_DISPLAY_KHR, CL_GLX_DISPLAY_KHR, CL_WGL_HDC_KHR, CL_CGL_SHAREGROUP_KHR
Accepted as an attribute name in thepropertiesargument ofCreateContextandCreateContextFromType.
-
-
Method Detail
-
clGetGLContextInfoKHR
public static int clGetGLContextInfoKHR(org.lwjgl.PointerBuffer properties, int param_name, @Nullable java.nio.ByteBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret) public static int clGetGLContextInfoKHR(org.lwjgl.PointerBuffer properties, int param_name, @Nullable org.lwjgl.PointerBuffer param_value, @Nullable org.lwjgl.PointerBuffer param_value_size_ret)Queries the OpenCL device currently corresponding to an OpenGL context.Such a device may not always exist (for example, if an OpenGL context is specified on a GPU not supporting OpenCL command queues, but which does support shared CL/GL objects), and if it does exist, may change over time. When such a device does exist, acquiring and releasing shared CL/GL objects may be faster on a command queue corresponding to this device than on command queues corresponding to other devices available to an OpenCL context.
- Parameters:
properties- points to an attribute list whose format and valid contents are identical to the {code properties} argument ofCreateContext.propertiesmust identify a single valid GL context or GL share group object.param_name- a constant that specifies the GL context information to query. One of:DEVICES_FOR_GL_CONTEXT_KHRCURRENT_DEVICE_FOR_GL_CONTEXT_KHRparam_value- a pointer to memory where the appropriate result being queried is returned. Ifparam_valueisNULL, it is ignored.param_value_size_ret- the actual size in bytes of data being queried byparam_value. IfNULL, it is ignored.- Returns:
SUCCESSif the function is executed successfully. If no device(s) exist corresponding toparam_name, the call will not fail, but the value ofparam_value_size_retwill be zero.Returns
INVALID_GL_SHAREGROUP_REFERENCE_KHRif a context was specified by any of the following means:- A context was specified for an EGL-based OpenGL ES or OpenGL implementation by setting the attributes
GL_CONTEXT_KHRandEGL_DISPLAY_KHR. - A context was specified for a GLX-based OpenGL implementation by setting the attributes
GL_CONTEXT_KHRandGLX_DISPLAY_KHR. - A context was specified for a WGL-based OpenGL implementation by setting the attributes
GL_CONTEXT_KHRandWGL_HDC_KHR.
and any of the following conditions hold:
- The specified display and context attributes do not identify a valid OpenGL or OpenGL ES context.
- The specified context does not support buffer and renderbuffer objects.
- The specified context is not compatible with the OpenCL context being created (for example, it exists in a physically distinct address space, such as another hardware device; or it does not support sharing data with OpenCL due to implementation restrictions).
Returns
INVALID_GL_SHAREGROUP_REFERENCE_KHRif a share group was specified for a CGL-based OpenGL implementation by setting the attributeCGL_SHAREGROUP_KHR, and the specified share group does not identify a valid CGL share group object.Returns
INVALID_OPERATIONif a context was specified as described above and any of the following conditions hold:- A context or share group object was specified for one of CGL, EGL, GLX, or WGL and the OpenGL implementation does not support that window-system binding API.
- More than one of the attributes
CGL_SHAREGROUP_KHR,EGL_DISPLAY_KHR,GLX_DISPLAY_KHR, andWGL_HDC_KHRis set to a non-default value. - Both of the attributes
CGL_SHAREGROUP_KHRandGL_CONTEXT_KHRare set to non-default values. - Any of the devices specified in the
devicesargument cannot support OpenCL objects which share the data store of an OpenGL object.
Returns
INVALID_VALUEif an invalid attribute name is specified inproperties.Additionally, returns
INVALID_VALUEifparam_nameis invalid, or if the size in bytes specified byparam_value_sizeis less than the size of the return type andparam_valueis not aNULLvalue,OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device, orOUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.- A context was specified for an EGL-based OpenGL ES or OpenGL implementation by setting the attributes
-
-