Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class KHRGLSharing

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the khr_gl_sharing extension.

Field Summary

Modifier and TypeField and Description
public static final int
CL_CGL_SHAREGROUP_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

public static final int
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR

Accepted as the param_name argument of GetGLContextInfoKHR.

public static final int
CL_DEVICES_FOR_GL_CONTEXT_KHR

Accepted as the param_name argument of GetGLContextInfoKHR.

public static final int
CL_EGL_DISPLAY_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

public static final int
CL_GL_CONTEXT_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

public static final int
CL_GLX_DISPLAY_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

public static final int
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR

Returned by CreateContext, CreateContextFromType, and GetGLContextInfoKHR when an invalid OpenGL context or share group object handle is specified in properties.

public static final int
CL_WGL_HDC_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

SUCCESS if the function is executed successfully. If no device(s) exist corresponding to param_name, the call will not fail, but the value of param_value_size_ret will be zero.

Returns INVALID_GL_SHAREGROUP_REFERENCE_KHR if a context was specified by any of the following means:

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 attribute CGL_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, and WGL_HDC_KHR is set to a non-default value.
  • Both of the attributes CGL_SHAREGROUP_KHR and GL_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 in properties.

Additionally, returns INVALID_VALUE if param_name is invalid, or if the size in bytes specified by param_value_size is less than the size of the return type and param_value is not a NULL value, OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device, or OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

clGetGLContextInfoKHR
(PointerBuffer
points to an attribute list whose format and valid contents are identical to the {code properties} argument of CreateContext. properties must identify a single valid GL context or GL share group object.
properties
,
int
a constant that specifies the GL context information to query. One of:
DEVICES_FOR_GL_CONTEXT_KHRCURRENT_DEVICE_FOR_GL_CONTEXT_KHR
param_name
,
ByteBuffer
a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.
param_value
,
PointerBuffer
the actual size in bytes of data being queried by param_value. If NULL, it is ignored.
param_value_size_ret
)

Queries the OpenCL device currently corresponding to an OpenGL context.

public static int

Returns:

SUCCESS if the function is executed successfully. If no device(s) exist corresponding to param_name, the call will not fail, but the value of param_value_size_ret will be zero.

Returns INVALID_GL_SHAREGROUP_REFERENCE_KHR if a context was specified by any of the following means:

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 attribute CGL_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, and WGL_HDC_KHR is set to a non-default value.
  • Both of the attributes CGL_SHAREGROUP_KHR and GL_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 in properties.

Additionally, returns INVALID_VALUE if param_name is invalid, or if the size in bytes specified by param_value_size is less than the size of the return type and param_value is not a NULL value, OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device, or OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

clGetGLContextInfoKHR
(PointerBuffer
points to an attribute list whose format and valid contents are identical to the {code properties} argument of CreateContext. properties must identify a single valid GL context or GL share group object.
properties
,
int
a constant that specifies the GL context information to query. One of:
DEVICES_FOR_GL_CONTEXT_KHRCURRENT_DEVICE_FOR_GL_CONTEXT_KHR
param_name
,
PointerBuffer
a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.
param_value
,
PointerBuffer
the actual size in bytes of data being queried by param_value. If NULL, it is ignored.
param_value_size_ret
)

Queries the OpenCL device currently corresponding to an OpenGL context.

public static int
nclGetGLContextInfoKHR(long properties, int param_name, long
the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.
param_value_size
,
long param_value, long param_value_size_ret)

Unsafe version of: GetGLContextInfoKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CL_CGL_SHAREGROUP_KHRback to summary
public static final int CL_CGL_SHAREGROUP_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHRback to summary
public static final int CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR

Accepted as the param_name argument of GetGLContextInfoKHR. Returns the CL device currently associated with the specified OpenGL context.

CL_DEVICES_FOR_GL_CONTEXT_KHRback to summary
public static final int CL_DEVICES_FOR_GL_CONTEXT_KHR

Accepted as the param_name argument of GetGLContextInfoKHR. Returns a list of all CL devices which may be associated with the specified OpenGL context.

CL_EGL_DISPLAY_KHRback to summary
public static final int CL_EGL_DISPLAY_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

CL_GL_CONTEXT_KHRback to summary
public static final int CL_GL_CONTEXT_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

CL_GLX_DISPLAY_KHRback to summary
public static final int CL_GLX_DISPLAY_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

CL_INVALID_GL_SHAREGROUP_REFERENCE_KHRback to summary
public static final int CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR

Returned by CreateContext, CreateContextFromType, and GetGLContextInfoKHR when an invalid OpenGL context or share group object handle is specified in properties.

CL_WGL_HDC_KHRback to summary
public static final int CL_WGL_HDC_KHR

Accepted as an attribute name in the properties argument of CreateContext and CreateContextFromType.

Constructor Detail

KHRGLSharingback to summary
protected KHRGLSharing()

Method Detail

clGetGLContextInfoKHRback to summary
public static 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.

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:PointerBuffer

points to an attribute list whose format and valid contents are identical to the {code properties} argument of CreateContext. properties must identify a single valid GL context or GL share group object.

param_name:int

a constant that specifies the GL context information to query. One of:

DEVICES_FOR_GL_CONTEXT_KHRCURRENT_DEVICE_FOR_GL_CONTEXT_KHR
param_value:ByteBuffer

a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.

param_value_size_ret:PointerBuffer

the actual size in bytes of data being queried by param_value. If NULL, it is ignored.

Returns:int

SUCCESS if the function is executed successfully. If no device(s) exist corresponding to param_name, the call will not fail, but the value of param_value_size_ret will be zero.

Returns INVALID_GL_SHAREGROUP_REFERENCE_KHR if a context was specified by any of the following means:

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 attribute CGL_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, and WGL_HDC_KHR is set to a non-default value.
  • Both of the attributes CGL_SHAREGROUP_KHR and GL_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 in properties.

Additionally, returns INVALID_VALUE if param_name is invalid, or if the size in bytes specified by param_value_size is less than the size of the return type and param_value is not a NULL value, OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device, or OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

Annotations
@NativeType:cl_int
clGetGLContextInfoKHRback to summary
public 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.

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:PointerBuffer

points to an attribute list whose format and valid contents are identical to the {code properties} argument of CreateContext. properties must identify a single valid GL context or GL share group object.

param_name:int

a constant that specifies the GL context information to query. One of:

DEVICES_FOR_GL_CONTEXT_KHRCURRENT_DEVICE_FOR_GL_CONTEXT_KHR
param_value:PointerBuffer

a pointer to memory where the appropriate result being queried is returned. If param_value is NULL, it is ignored.

param_value_size_ret:PointerBuffer

the actual size in bytes of data being queried by param_value. If NULL, it is ignored.

Returns:int

SUCCESS if the function is executed successfully. If no device(s) exist corresponding to param_name, the call will not fail, but the value of param_value_size_ret will be zero.

Returns INVALID_GL_SHAREGROUP_REFERENCE_KHR if a context was specified by any of the following means:

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 attribute CGL_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, and WGL_HDC_KHR is set to a non-default value.
  • Both of the attributes CGL_SHAREGROUP_KHR and GL_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 in properties.

Additionally, returns INVALID_VALUE if param_name is invalid, or if the size in bytes specified by param_value_size is less than the size of the return type and param_value is not a NULL value, OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device, or OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

Annotations
@NativeType:cl_int
nclGetGLContextInfoKHRback to summary
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:long

the size in bytes of memory pointed to by param_value. This size must be ≥ size of return type. If param_value is NULL, it is ignored.