'\" t .\" Title: cl_khr_gl_event .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CL_KHR_GL_EVENT" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" cl_khr_gl_event \- Create an OpenCL event object from a GL sync object\&. .SS "" .TS tab(:); l. T{ cl_khr_gl_event T} .TE .sp 1 .SH "DESCRIPTION" .PP This extension enables the function \fBclCreateEventFromGLsyncKHR\fR(3clc)\&. .PP This extension allows creating OpenCL event objects linked to OpenGL fence sync objects, potentially improving efficiency of sharing images and buffers between the two APIs\&. The companion \fBGL_ARB_cl_event\fR OpenGL extension provides the complementary functionality of creating an OpenGL sync object from an OpenCL event object\&. .PP In addition, this extension modifies the behavior of \fBclEnqueueAcquireGLObjects\fR(3clc) and \fBclEnqueueReleaseGLObjects\fR(3clc) to implicitly guarantee synchronization with an OpenGL context bound in the same thread as the OpenCL context\&. .PP If this extension is supported by an implementation, the string \fBcl_khr_gl_event\fR will be present in the CL_PLATFORM_EXTENSIONS or CL_DEVICE_EXTENSIONS string described in the table of \fIparam_name\fR values for \fBclGetDeviceInfo\fR(3clc)\&. .SH "NOTES" .PP Event objects can also be used to reflect the status of an OpenGL sync object\&. The sync object in turn refers to a fence command executing in an OpenGL command stream\&. This provides another method of coordinating sharing of buffers and images between OpenGL and OpenCL (see section 9\&.7\&.6\&.1)\&. .PP If the cl_khr_gl_event extension is supported, then the OpenCL implementation will ensure that any such pending OpenGL operations are complete for an OpenGL context bound to the same thread as the OpenCL context\&. This is referred to as implicit synchronization\&. .PP If the \fBcl_khr_gl_event\fR extension is supported and the OpenGL context in question supports fence sync objects, completion of OpenGL commands may also be determined by placing a GL fence command after those commands using \fBglFenceSync\fR, creating an event from the resulting GL sync object using \fBclCreateEventFromGLsyncKHR\fR(3clc), and determining completion of that event object via \fBclEnqueueAcquireGLObjects\fR(3clc)\&. This method may be considerably more efficient than calling \fBglFinish\fR, and is referred to as \fIexplicit synchronization\fR\&. Explicit synchronization is most useful when an OpenGL context bound to another thread is accessing the memory objects\&. .PP If the \fBcl_khr_gl_event\fR extension is not supported, completion of OpenGL commands may be determined by issuing and waiting for completion of a \fBglFinish\fR command on all OpenGL contexts with pending references to these objects\&. Some implementations may offer other efficient synchronization methods\&. If such methods exist they will be described in platform\-specific documentation\&. .PP Note that no synchronization method other than \fBglFinish\fR is portable between all OpenGL implementations and all OpenCL implementations\&. While this is the only way to ensure completion that is portable to all platforms, \fBglFinish\fR is an expensive operation and its use should be avoided if the \fBcl_khr_gl_event\fR extension is supported on a platform\&. .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBEXTENSION\fR(3clc), \fBclCreateEventFromGLsyncKHR\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 61, section 9.8 - Creating CL event objets .RE