cl_event
clCreateEventFromGLsyncKHR
(
| cl_context context, |
GLsync sync, | |
cl_int *errcode_ret) |
context
A valid OpenCL context created from an OpenGL context or share group, using the cl_khr_gl_sharing extension.
sync
The name of a sync object in the GL share group associated with context
.
errcode_ret
Returns an appropriate error code as described below. If errcode_ret
is
NULL, no error code is returned.
An event object may be created by linking to an OpenGL sync object. Completion of such an event object is equivalent to waiting for completion of the fence command associated with the linked GL sync object.
The parameters of an event object linked to a GL sync object will return the following values when queried with clGetEventInfo:
clCreateEventFromGLsyncKHR
performs an implicit
clRetainEvent on the returned
event object. Creating a linked event object also places a reference on the linked GL sync
object. When the event object is deleted, the reference will be removed from the GL sync object.
Events returned from clCreateEventFromGLsyncKHR
may only be consumed by
clEnqueueAcquireGLObjects. Passing
such events to any other CL API will generate a CL_INVALID_EVENT error.
Returns a valid OpenCL event object and errcode_ret
is set to
CL_SUCCESS if the event object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in errcode_ret
:
context
is not a valid context or was
not created from a GL context.
sync
is not the name of a sync
object in the GL share group associated with context
.