5.5.15.1.2. Synchronization With OpenGL
5.5.15.1.2. 与OpenGL同步
When sharing with an OpenGL context via the cl_khr_gl_sharing extension, 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.
当通过cl_khr_gl_sharing扩展与OpenGL上下文共享时,OpenCL实现将确保对与OpenCL上下文绑定到同一线程的OpenGL上下文完成任何此类挂起的OpenGL操作。这被称为隐式同步。
If the cl_khr_gl_event extension is supported, and the OpenGL context in question supports fence sync objects, explicit synchronization with OpenGL can be achieved as described in the Explicit Synchronization Using OpenGL Fence Sync Objects section.
如果支持cl_khr_gl_event扩展,并且有问题的OpenGL上下文支持栅栏同步对象,则可以实现与OpenGL的显式同步,如“使用OpenGL栅栏同步对象进行显式同步”部分所述。
If the cl_khr_gl_event extension is not supported, completion of OpenGL commands may be determined by issuing and waiting for completion of a glFinish
command on all OpenGL contexts with pending references to these objects.
如果不支持cl_khr_gl_event扩展,则可以通过在所有具有对这些对象的未决引用的OpenGL上下文上发出并等待glFinish命令的完成来确定OpenGL命令的完成。