5.5.15.1. Synchronizing Access to Memory Objects Shared With EGL or OpenGL
5.5.15.1. 同步访问与EGL或OpenGL共享的内存对象
When sharing objects such as EGL images (if the cl_khr_egl_image extension is supported) or OpenGL buffers, textures, and renderbuffers (if the cl_khr_gl_sharing extension is supported), in order to ensure data integrity, the application is responsible for synchronizing access to shared memory objects through the other API with which such objects are shared.
当共享诸如EGL图像(如果支持cl_khr_egl_image扩展)或OpenGL缓冲区、纹理和渲染缓冲区(如果支持cl_khr_gl_sharing扩展)之类的对象时,为了确保数据的完整性,应用程序负责通过与共享这些对象的其他API同步对共享内存对象的访问。
Failure to provide such synchronization may result in race conditions and other undefined behavior including non-portability between implementations.
未能提供这种同步可能导致竞争条件和其他未定义的行为,包括实现之间的不可移植性。
Prior to acquiring objects shared with the other API, the application must ensure that any pending operations in that API which accesses the objects specified in mem_objects have completed.
在获取与其他API共享的对象之前,应用程序必须确保访问mem_objects中指定的对象的API中的任何挂起操作都已完成。
Depending on the application and the implementation, there are two extensions which may be used to synchronize with other APIs:
根据应用程序和实现的不同,有两个扩展可以用于与其他API同步: