Class KHRGLSharing
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static final int
Accepted as theparam_name
argument ofGetGLContextInfoKHR
.static final int
Accepted as theparam_name
argument ofGetGLContextInfoKHR
.static final int
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static final int
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static final int
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.static final int
Returned byCreateContext
,CreateContextFromType
, andGetGLContextInfoKHR
when an invalid OpenGL context or share group object handle is specified inproperties
.static final int
Accepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
clGetGLContextInfoKHR
(PointerBuffer properties, int param_name, ByteBuffer param_value, PointerBuffer param_value_size_ret) Queries the OpenCL device currently corresponding to an OpenGL context.static int
clGetGLContextInfoKHR
(PointerBuffer properties, int param_name, PointerBuffer param_value, 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 Details
-
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR
public static final int CL_INVALID_GL_SHAREGROUP_REFERENCE_KHRReturned byCreateContext
,CreateContextFromType
, andGetGLContextInfoKHR
when an invalid OpenGL context or share group object handle is specified inproperties
.- See Also:
-
CL_DEVICES_FOR_GL_CONTEXT_KHR
public static final int CL_DEVICES_FOR_GL_CONTEXT_KHRAccepted as theparam_name
argument ofGetGLContextInfoKHR
. Returns a list of all CL devices which may be associated with the specified OpenGL context.- See Also:
-
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
public static final int CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHRAccepted as theparam_name
argument ofGetGLContextInfoKHR
. Returns the CL device currently associated with the specified OpenGL context.- See Also:
-
CL_GL_CONTEXT_KHR
public static final int CL_GL_CONTEXT_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.- See Also:
-
CL_EGL_DISPLAY_KHR
public static final int CL_EGL_DISPLAY_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.- See Also:
-
CL_GLX_DISPLAY_KHR
public static final int CL_GLX_DISPLAY_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.- See Also:
-
CL_WGL_HDC_KHR
public static final int CL_WGL_HDC_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.- See Also:
-
CL_CGL_SHAREGROUP_KHR
public static final int CL_CGL_SHAREGROUP_KHRAccepted as an attribute name in theproperties
argument ofCreateContext
andCreateContextFromType
.- See Also:
-
-
Method Details
-
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(PointerBuffer properties, int param_name, @Nullable ByteBuffer param_value, @Nullable 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
-
clGetGLContextInfoKHR
public static int clGetGLContextInfoKHR(PointerBuffer properties, int param_name, @Nullable PointerBuffer param_value, @Nullable 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
-