Class KHRGLSharing
- java.lang.Object
-
- org.lwjgl.opencl.KHRGLSharing
-
public class KHRGLSharing extends java.lang.Object
Native bindings to the khr_gl_sharing extension.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CL_CGL_SHAREGROUP_KHR
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static int
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
CL_DEVICES_FOR_GL_CONTEXT_KHRAccepted as theparam_name
argument ofGetGLContextInfoKHR
.static int
CL_EGL_DISPLAY_KHR
CL_GL_CONTEXT_KHR
CL_GLX_DISPLAY_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static int
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR
Returned byCreateContext
,CreateContextFromType
, andGetGLContextInfoKHR
when an invalid OpenGL context or share group object handle is specified inproperties
.static int
CL_WGL_HDC_KHR
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
clGetGLContextInfoKHR(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 int
clGetGLContextInfoKHR(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.static int
nclGetGLContextInfoKHR(long properties, int param_name, long param_value_size, long param_value, long param_value_size_ret)
Unsafe version of:GetGLContextInfoKHR
-
-
-
Field Detail
-
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR
Returned byCreateContext
,CreateContextFromType
, andGetGLContextInfoKHR
when an invalid OpenGL context or share group object handle is specified inproperties
.
-
CL_DEVICES_FOR_GL_CONTEXT_KHR
Accepted as theparam_name
argument 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_name
argument 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 theproperties
argument ofCreateContext
andCreateContextFromType
.
-
-
Method Detail
-
nclGetGLContextInfoKHR
public static int nclGetGLContextInfoKHR(long properties, int param_name, long param_value_size, long param_value, long param_value_size_ret)
Unsafe version of:GetGLContextInfoKHR
- Parameters:
param_value_size
- the size in bytes of memory pointed to byparam_value
. This size must be ≥ size of return type. Ifparam_value
isNULL
, it is ignored.
-
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
.properties
must 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_KHR
CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
param_value
- a pointer to memory where the appropriate result being queried is returned. Ifparam_value
isNULL
, it is ignored.param_value_size_ret
- the actual size in bytes of data being queried byparam_value
. IfNULL
, it is ignored.- Returns:
SUCCESS
if the function is executed successfully. If no device(s) exist corresponding toparam_name
, the call will not fail, but the value ofparam_value_size_ret
will be zero.Returns
INVALID_GL_SHAREGROUP_REFERENCE_KHR
if 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_KHR
andEGL_DISPLAY_KHR
. - A context was specified for a GLX-based OpenGL implementation by setting the attributes
GL_CONTEXT_KHR
andGLX_DISPLAY_KHR
. - A context was specified for a WGL-based OpenGL implementation by setting the attributes
GL_CONTEXT_KHR
andWGL_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_KHR
if 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_OPERATION
if 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_KHR
is set to a non-default value. - Both of the attributes
CGL_SHAREGROUP_KHR
andGL_CONTEXT_KHR
are set to non-default values. - Any of the devices specified in the
devices
argument cannot support OpenCL objects which share the data store of an OpenGL object.
Returns
INVALID_VALUE
if an invalid attribute name is specified inproperties
.Additionally, returns
INVALID_VALUE
ifparam_name
is invalid, or if the size in bytes specified byparam_value_size
is less than the size of the return type andparam_value
is not aNULL
value,OUT_OF_RESOURCES
if there is a failure to allocate resources required by the OpenCL implementation on the device, orOUT_OF_HOST_MEMORY
if 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
-
-