cl_int
clGetGLContextInfoKHR
(
| const cl_context_properties *properties, |
cl_gl_context_info param_name, | |
size_t param_value_size, | |
void *param_value, | |
size_t *param_value_size_ret) |
properties
Points to an attribute list whose format and valid contents are identical to the
properties
argument of
clCreateContext.
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, and must be one of:
param_value_size
Returns the actual size in bytes of data being queried by param_value
.
If param_value_size_ret
is NULL, it is ignored
param_value
A pointer to memory where the appropriate result is returned. If param_value
is NULL, it is ignored.
param_value_size_ret
Returns the actual size in bytes of data being queried to param_value
.
If param_value_size_ret
is NULL, it is ignored.
This extension defines optional attributes to OpenCL context creation routines which associate a GL context or share group object with a newly created OpenCL context. If this extension is supported by an implementation, the string cl_khr_gl_sharing will be present in the CL_PLATFORM_EXTENSIONS or CL_DEVICE_EXTENSIONS string.
Returns CL_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. Otherwise returns one
of the following:
Returns CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR if a context was specified by any of the following means:
and any of the following conditions hold:
Returns CL_INVALID_OPERATION if a context was specified as described above and any of the following conditions hold:
devices
argument cannot support OpenCL objects which share
the data store of an OpenGL object.
properties
: CL_GL_CONTEXT_KHR, CL_CGL_SHAREGROUP_KHR, CL_EGL_DISPLAY_KHR, CL_GLX_DISPLAY_KHR,
CL_WGL_HDC_KHR.
param_name
is not
CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR or CL_DEVICES_FOR_GL_CONTEXT_KHR; or if the size in bytes specified
by param_value_size
is less than the size of CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
or CL_DEVICES_FOR_GL_CONTEXT_KHR; and param_value
is not a NULL value.