102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci EXT_sync_reuse 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_EXT_sync_reuse 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContributors 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Daniel Kartch 1202f4aeb0Sopenharmony_ci Jeff Vigil 1302f4aeb0Sopenharmony_ci Ray Smith 1402f4aeb0Sopenharmony_ci 1502f4aeb0Sopenharmony_ciContacts 1602f4aeb0Sopenharmony_ci 1702f4aeb0Sopenharmony_ci Daniel Kartch, NVIDIA Corporation (dkartch 'at' nvidia.com) 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ciStatus 2002f4aeb0Sopenharmony_ci 2102f4aeb0Sopenharmony_ci Complete 2202f4aeb0Sopenharmony_ci 2302f4aeb0Sopenharmony_ciVersion 2402f4aeb0Sopenharmony_ci 2502f4aeb0Sopenharmony_ci Version 4, May 16, 2018 2602f4aeb0Sopenharmony_ci 2702f4aeb0Sopenharmony_ciNumber 2802f4aeb0Sopenharmony_ci 2902f4aeb0Sopenharmony_ci EGL Extension #128 3002f4aeb0Sopenharmony_ci 3102f4aeb0Sopenharmony_ciExtension type 3202f4aeb0Sopenharmony_ci 3302f4aeb0Sopenharmony_ci EGL display extension 3402f4aeb0Sopenharmony_ci 3502f4aeb0Sopenharmony_ciDependencies 3602f4aeb0Sopenharmony_ci 3702f4aeb0Sopenharmony_ci Requires EGL 1.5 or EGL 1.4 with EGL_KHR_fence_sync 3802f4aeb0Sopenharmony_ci 3902f4aeb0Sopenharmony_ci Interacts with EGL_KHR_reusable_sync 4002f4aeb0Sopenharmony_ci Interacts with EGL_ANDROID_native_fence_sync 4102f4aeb0Sopenharmony_ci Interacts with EGL_NV_cuda_event 4202f4aeb0Sopenharmony_ci 4302f4aeb0Sopenharmony_ci This extension is written against the wording of the EGL 1.5 4402f4aeb0Sopenharmony_ci Specification. 4502f4aeb0Sopenharmony_ci 4602f4aeb0Sopenharmony_ciOverview 4702f4aeb0Sopenharmony_ci 4802f4aeb0Sopenharmony_ci The original EGLSync extensions separated sync objects into two 4902f4aeb0Sopenharmony_ci types: fence sync objects signaled by one time events in an 5002f4aeb0Sopenharmony_ci API command pipeline; and reusable sync objects signaled by commands 5102f4aeb0Sopenharmony_ci which can be issued again and again. However, this conflates 5202f4aeb0Sopenharmony_ci reusability of the event triggering a sync object with the EGLSync 5302f4aeb0Sopenharmony_ci object itself. 5402f4aeb0Sopenharmony_ci 5502f4aeb0Sopenharmony_ci Although the event associated with a fence sync object will only 5602f4aeb0Sopenharmony_ci occur once, there is no reason that it can't be replaced with a new 5702f4aeb0Sopenharmony_ci event. Doing so would avoid unnecessary allocation and free 5802f4aeb0Sopenharmony_ci operations in an application that repeatedly waits for events. With 5902f4aeb0Sopenharmony_ci the current interfaces, such applications must constantly create and 6002f4aeb0Sopenharmony_ci destroy new EGLSync objects. 6102f4aeb0Sopenharmony_ci 6202f4aeb0Sopenharmony_ci This extension allows all sync objects to be reusable. When a sync 6302f4aeb0Sopenharmony_ci object is in the signaled state, it can be reset back to an 6402f4aeb0Sopenharmony_ci unsignaled state, regenerating or reevaluating the events that 6502f4aeb0Sopenharmony_ci trigger them. For fence sync objects, this means generating a new 6602f4aeb0Sopenharmony_ci fence in the current API. For OpenCL event sync objects, this means 6702f4aeb0Sopenharmony_ci waiting for a new OpenCL event handle. This mechanism also allows 6802f4aeb0Sopenharmony_ci sync objects to be created in the signaled state with no associated 6902f4aeb0Sopenharmony_ci fence/event, and have one applied later. Thus all EGLSyncs required 7002f4aeb0Sopenharmony_ci by an application can be allocated up front, before any rendering 7102f4aeb0Sopenharmony_ci operations have begun. 7202f4aeb0Sopenharmony_ci 7302f4aeb0Sopenharmony_ciNew Types 7402f4aeb0Sopenharmony_ci 7502f4aeb0Sopenharmony_ci None 7602f4aeb0Sopenharmony_ci 7702f4aeb0Sopenharmony_ciNew Tokens 7802f4aeb0Sopenharmony_ci 7902f4aeb0Sopenharmony_ci None 8002f4aeb0Sopenharmony_ci 8102f4aeb0Sopenharmony_ciNew Procedures and Functions 8202f4aeb0Sopenharmony_ci 8302f4aeb0Sopenharmony_ci EGLBoolean eglUnsignalSyncEXT( 8402f4aeb0Sopenharmony_ci EGLDisplay dpy, 8502f4aeb0Sopenharmony_ci EGLSync sync, 8602f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list); 8702f4aeb0Sopenharmony_ci 8802f4aeb0Sopenharmony_ciReplace text of subsections of 3.8.1 through 3.8.1.2 of EGL 1.5 8902f4aeb0Sopenharmony_ciSpecification. Existing tables are preserved. 9002f4aeb0Sopenharmony_ci 9102f4aeb0Sopenharmony_ci 3.8.1 Sync Objects 9202f4aeb0Sopenharmony_ci 9302f4aeb0Sopenharmony_ci In addition to the aforementioned synchronization functions, which 9402f4aeb0Sopenharmony_ci provide an efficient means of serializing client and native API 9502f4aeb0Sopenharmony_ci operations within a thread, <sync objects> are provided to enable 9602f4aeb0Sopenharmony_ci synchronization of client API operations between threads and/or 9702f4aeb0Sopenharmony_ci between API contexts. Sync objects may be tested or waited upon by 9802f4aeb0Sopenharmony_ci application threads. 9902f4aeb0Sopenharmony_ci 10002f4aeb0Sopenharmony_ci Sync objects have a status with two possible states: <signaled> and 10102f4aeb0Sopenharmony_ci <unsignaled>, and may initially be in either state. EGL may be asked 10202f4aeb0Sopenharmony_ci to wait for a sync object to become signaled, or a sync object�s 10302f4aeb0Sopenharmony_ci status may be queried. 10402f4aeb0Sopenharmony_ci 10502f4aeb0Sopenharmony_ci Depending on the type of a sync object, its status may be changed 10602f4aeb0Sopenharmony_ci either by an external event, or by explicitly signaling and/or 10702f4aeb0Sopenharmony_ci unsignaling the sync. All sync objects are reusable. Once they enter 10802f4aeb0Sopenharmony_ci the signaled state, they may be changed back to unsignaled, possibly 10902f4aeb0Sopenharmony_ci replacing the associated external event that signals them. 11002f4aeb0Sopenharmony_ci 11102f4aeb0Sopenharmony_ci Sync objects are associated with an EGLDisplay when they are 11202f4aeb0Sopenharmony_ci created, and have <attributes> defining additional aspects of the 11302f4aeb0Sopenharmony_ci sync object. All sync objects include attributes for their type and 11402f4aeb0Sopenharmony_ci their status. Additional attributes are discussed below for 11502f4aeb0Sopenharmony_ci different types of sync objects. If a sync object is created in the 11602f4aeb0Sopenharmony_ci signaled state, its initial attribute list may be incomplete, with 11702f4aeb0Sopenharmony_ci attributes necessary for its type provided when it is changed to 11802f4aeb0Sopenharmony_ci unsignaled. 11902f4aeb0Sopenharmony_ci 12002f4aeb0Sopenharmony_ci <Fence sync objects> have an associated fence command in a client 12102f4aeb0Sopenharmony_ci API. A new fence command is generated whenever the sync object 12202f4aeb0Sopenharmony_ci enters the unsignaled state. When the client API executes the fence 12302f4aeb0Sopenharmony_ci command, an event is generated which signals the corresponding fence 12402f4aeb0Sopenharmony_ci sync object. Fence sync objects may not be explicitly signaled. 12502f4aeb0Sopenharmony_ci Fence sync objects may be used to wait for partial completion of a 12602f4aeb0Sopenharmony_ci client API command stream, as a more flexible form of glFinish or 12702f4aeb0Sopenharmony_ci vgFinish. 12802f4aeb0Sopenharmony_ci 12902f4aeb0Sopenharmony_ci An <OpenCL event sync object> reflects the status of a corresponding 13002f4aeb0Sopenharmony_ci OpenCL event object to which the sync object is linked. This 13102f4aeb0Sopenharmony_ci provides another method of coordinating sharing of images between 13202f4aeb0Sopenharmony_ci EGL and OpenCL (see Chapter 9 of the OpenCL 1.0 Specification and 13302f4aeb0Sopenharmony_ci the cl_khr_egl_image extension). Waiting on such a sync object is 13402f4aeb0Sopenharmony_ci equivalent to waiting for completion of the linked OpenCL event 13502f4aeb0Sopenharmony_ci object. 13602f4aeb0Sopenharmony_ci 13702f4aeb0Sopenharmony_ci The command 13802f4aeb0Sopenharmony_ci 13902f4aeb0Sopenharmony_ci EGLSync eglCreateSync(EGLDisplay dpy, EGLenum type, const 14002f4aeb0Sopenharmony_ci EGLAttrib *attrib_list); 14102f4aeb0Sopenharmony_ci 14202f4aeb0Sopenharmony_ci creates a sync object of the specified <type> associated with the 14302f4aeb0Sopenharmony_ci specified display <dpy>, and returns a handle to the new object. 14402f4aeb0Sopenharmony_ci <attrib list> is NULL or an attribute-value list specifying other 14502f4aeb0Sopenharmony_ci attributes of the sync object, terminated by an attribute entry 14602f4aeb0Sopenharmony_ci EGL_NONE. Attributes not specified in the list will be assigned 14702f4aeb0Sopenharmony_ci their default values. 14802f4aeb0Sopenharmony_ci 14902f4aeb0Sopenharmony_ci The EGL_SYNC_STATUS attribute is defined for all sync types, but may 15002f4aeb0Sopenharmony_ci only be specified explicitly at creation time for some types of sync 15102f4aeb0Sopenharmony_ci objects, as discussed below. Other attributes are only allowed as 15202f4aeb0Sopenharmony_ci indicated below for the sync type. 15302f4aeb0Sopenharmony_ci 15402f4aeb0Sopenharmony_ci Errors 15502f4aeb0Sopenharmony_ci 15602f4aeb0Sopenharmony_ci eglCreateSync returns EGL_NO_SYNC on failure. 15702f4aeb0Sopenharmony_ci If <dpy> is not the name of a valid, initialized EGLDisplay, an 15802f4aeb0Sopenharmony_ci EGL_BAD_DISPLAY error is generated. 15902f4aeb0Sopenharmony_ci If <attrib_list> contains an attribute name not defined or not 16002f4aeb0Sopenharmony_ci allowed for the type of sync object being created, an 16102f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. 16202f4aeb0Sopenharmony_ci If <type> is not a supported type of sync object, an 16302f4aeb0Sopenharmony_ci EGL_BAD_PARAMETER error is generated. 16402f4aeb0Sopenharmony_ci If <type> is EGL_SYNC_FENCE, the EGL_SYNC_STATUS attribute is 16502f4aeb0Sopenharmony_ci set to EGL_UNSIGNALED, and any of the following are true of the 16602f4aeb0Sopenharmony_ci current context for the bound API (the context returned by 16702f4aeb0Sopenharmony_ci eglGetCurrentContext), an EGL_BAD_MATCH error is generated: 16802f4aeb0Sopenharmony_ci * There is no current context (i.e., eglGetCurrentContext 16902f4aeb0Sopenharmony_ci returns EGL_NO_CONTEXT). 17002f4aeb0Sopenharmony_ci * <dpy> does not match the EGLDisplay of the context (the 17102f4aeb0Sopenharmony_ci EGLDisplay returned by eglGetCurrentDisplay). 17202f4aeb0Sopenharmony_ci * The context does not support fence commands. 17302f4aeb0Sopenharmony_ci 17402f4aeb0Sopenharmony_ci While in the unsignaled state, the synchronization event associated 17502f4aeb0Sopenharmony_ci with a sync object cannot be changed. When the <condition> of a sync 17602f4aeb0Sopenharmony_ci object in the unsignaled state is satisfied, the sync is signaled, 17702f4aeb0Sopenharmony_ci causing any eglClientWaitSync or eglWaitSync commands (see below) 17802f4aeb0Sopenharmony_ci blocking on the sync to unblock. 17902f4aeb0Sopenharmony_ci 18002f4aeb0Sopenharmony_ci Once signaled, a sync object may be reused for a new synchronization 18102f4aeb0Sopenharmony_ci event by switching it back to unsignaled. The command 18202f4aeb0Sopenharmony_ci 18302f4aeb0Sopenharmony_ci EGLBoolean eglUnsignalSyncEXT(EGLDisplay dpy, EGLSync sync, 18402f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list); 18502f4aeb0Sopenharmony_ci 18602f4aeb0Sopenharmony_ci can be used to change the <sync> associated with display <dpy> from 18702f4aeb0Sopenharmony_ci the signaled state to the unsignaled state. The attribute list may 18802f4aeb0Sopenharmony_ci be used to provide or replace attributes specific to the sync type 18902f4aeb0Sopenharmony_ci as discussed below. The sync object's type and condition may not be 19002f4aeb0Sopenharmony_ci changed. 19102f4aeb0Sopenharmony_ci 19202f4aeb0Sopenharmony_ci Errors 19302f4aeb0Sopenharmony_ci 19402f4aeb0Sopenharmony_ci eglUnsignalSyncEXT returns EGL_FALSE on failure, and has no 19502f4aeb0Sopenharmony_ci effect on <sync>. 19602f4aeb0Sopenharmony_ci If <dpy> is not the name of a valid, initialized EGLDisplay, an 19702f4aeb0Sopenharmony_ci EGL_BAD_DISPLAY error is generated. 19802f4aeb0Sopenharmony_ci If <sync> is not a valid sync object associated with <dpy>, an 19902f4aeb0Sopenharmony_ci EGL_BAD_PARAMETER error is generated. 20002f4aeb0Sopenharmony_ci If <attrib_list> contains an attribute name not defined for the 20102f4aeb0Sopenharmony_ci type of <sync>, an EGL_BAD_ATTRIBUTE error is generated. 20202f4aeb0Sopenharmony_ci If <sync> is already in the unsignaled state, an EGL_BAD_ACCESS 20302f4aeb0Sopenharmony_ci error is generated. 20402f4aeb0Sopenharmony_ci If <sync>'s type is EGL_SYNC_FENCE and any of the following are 20502f4aeb0Sopenharmony_ci true of the current context for the bound API (the context 20602f4aeb0Sopenharmony_ci returned by eglGetCurrentContext), an EGL_BAD_MATCH error is 20702f4aeb0Sopenharmony_ci generated: 20802f4aeb0Sopenharmony_ci * There is no current context (i.e., eglGetCurrentContext 20902f4aeb0Sopenharmony_ci returns EGL_NO_CONTEXT). 21002f4aeb0Sopenharmony_ci * <dpy> does not match the EGLDisplay of the context (the 21102f4aeb0Sopenharmony_ci EGLDisplay returned by eglGetCurrentDisplay). 21202f4aeb0Sopenharmony_ci * The context does not support fence commands. 21302f4aeb0Sopenharmony_ci If <sync>'s type is EGL_SYNC_CL_EVENT and EGL_CL_EVENT_HANDLE 21402f4aeb0Sopenharmony_ci is not specified in <attrib_list>, then an EGL_BAD_ATTRIBUTE 21502f4aeb0Sopenharmony_ci error is generated. 21602f4aeb0Sopenharmony_ci 21702f4aeb0Sopenharmony_ci 3.8.1.1 Creating and Signaling Fence Sync Objects 21802f4aeb0Sopenharmony_ci 21902f4aeb0Sopenharmony_ci If type is EGL_SYNC_FENCE, a fence sync object is created. The 22002f4aeb0Sopenharmony_ci EGL_SYNC_STATUS attribute may be specified as either EGL_UNSIGNALED 22102f4aeb0Sopenharmony_ci or EGL_SIGNALED, and will default to EGL_UNSIGNALED. No other 22202f4aeb0Sopenharmony_ci attributes may be specified for a fence sync object, either with 22302f4aeb0Sopenharmony_ci eglCreateSync or eglUnsignalSyncEXT. Queriable attributes of the 22402f4aeb0Sopenharmony_ci fence sync object are set as shown in table 3.7. 22502f4aeb0Sopenharmony_ci 22602f4aeb0Sopenharmony_ci When a fence sync object is created in the unsignaled state, or 22702f4aeb0Sopenharmony_ci switched to that state with eglUnsignalSyncEXT, a fence command is 22802f4aeb0Sopenharmony_ci inserted into the command stream of the bound client API�s current 22902f4aeb0Sopenharmony_ci context (i.e., the context returned by eglGetCurrentContext), and is 23002f4aeb0Sopenharmony_ci associated with the sync object. 23102f4aeb0Sopenharmony_ci 23202f4aeb0Sopenharmony_ci The only condition supported for fence sync objects is 23302f4aeb0Sopenharmony_ci EGL_SYNC_PRIOR_COMMANDS_COMPLETE, which is satisfied by completion 23402f4aeb0Sopenharmony_ci of the fence command corresponding to the sync object, and all 23502f4aeb0Sopenharmony_ci preceding commands in the associated client API context�s command 23602f4aeb0Sopenharmony_ci stream. The sync object will not be signaled until all effects from 23702f4aeb0Sopenharmony_ci these commands on the client API�s internal and framebuffer state 23802f4aeb0Sopenharmony_ci are fully realized. No other state is affected by execution of the 23902f4aeb0Sopenharmony_ci fence command. 24002f4aeb0Sopenharmony_ci 24102f4aeb0Sopenharmony_ci Generation of fence commands for fence sync objects requires support 24202f4aeb0Sopenharmony_ci from the bound client API, and will not succeed unless the client 24302f4aeb0Sopenharmony_ci API satisfies one of the following properties. Note that eglWaitSync 24402f4aeb0Sopenharmony_ci (see section 3.8.1.3) also requires satisfying these conditions. 24502f4aeb0Sopenharmony_ci * client API is OpenGL, and either the OpenGL version is 3.2 or 24602f4aeb0Sopenharmony_ci greater, or the GL_ARB_sync extension is supported. 24702f4aeb0Sopenharmony_ci * client API is OpenGL ES, and either the OpenGL ES version is 3.0 24802f4aeb0Sopenharmony_ci or greater, or the GL_OES_EGL_sync extension is supported. 24902f4aeb0Sopenharmony_ci * client API is OpenVG, and the VG_KHR_EGL_sync extension is 25002f4aeb0Sopenharmony_ci supported. 25102f4aeb0Sopenharmony_ci 25202f4aeb0Sopenharmony_ci 3.8.1.2 Creating and Signaling OpenCL Event Sync Objects 25302f4aeb0Sopenharmony_ci 25402f4aeb0Sopenharmony_ci If type is EGL_SYNC_CL_EVENT, an OpenCL event sync object is 25502f4aeb0Sopenharmony_ci created. The EGL_SYNC_STATUS attribute may not be explicitly 25602f4aeb0Sopenharmony_ci specified during creation of this type of sync object. If no 25702f4aeb0Sopenharmony_ci EGL_CL_EVENT_HANDLE attribute is specified at creation time, the 25802f4aeb0Sopenharmony_ci sync object will be created in the signaled state. Otherwise its 25902f4aeb0Sopenharmony_ci status will be determined by the provided OpenCL event, as described 26002f4aeb0Sopenharmony_ci below. An EGL_CL_EVENT_HANDLE must always be specified for 26102f4aeb0Sopenharmony_ci eglUnsignalSyncEXT. 26202f4aeb0Sopenharmony_ci 26302f4aeb0Sopenharmony_ci To use an OpenCL event sync object, the EGL_SYNC_CL_EVENT attribute 26402f4aeb0Sopenharmony_ci must be set to a valid OpenCL <event> handle returned by a call to 26502f4aeb0Sopenharmony_ci clEnqueueReleaseGLObjects or clEnqueueReleaseEGLObjects; other types 26602f4aeb0Sopenharmony_ci of OpenCL event handles are not supported. Implementations are not 26702f4aeb0Sopenharmony_ci required to validate the OpenCL event, and passing an invalid event 26802f4aeb0Sopenharmony_ci handle in <attrib_list> may result in undefined behavior up to and 26902f4aeb0Sopenharmony_ci including program termination. Note that EGL_CL_EVENT_HANDLE is not 27002f4aeb0Sopenharmony_ci a queriable property of a sync object. Queriable attributes of the 27102f4aeb0Sopenharmony_ci OpenCL event sync object are set as shown in table 3.8. 27202f4aeb0Sopenharmony_ci 27302f4aeb0Sopenharmony_ci The status of such a sync object depends on <event>. When the status 27402f4aeb0Sopenharmony_ci of <event> is CL_QUEUED, CL_SUBMITTED, or CL_RUNNING, the status of 27502f4aeb0Sopenharmony_ci the linked sync object will be EGL_UNSIGNALED. When the status of 27602f4aeb0Sopenharmony_ci <event> changes to CL_COMPLETE, the status of the linked sync object 27702f4aeb0Sopenharmony_ci will become EGL_SIGNALED. 27802f4aeb0Sopenharmony_ci 27902f4aeb0Sopenharmony_ci The only condition supported for OpenCL event sync objects is 28002f4aeb0Sopenharmony_ci EGL_SYNC_CL_EVENT_COMPLETE, which is satisfied when the status of 28102f4aeb0Sopenharmony_ci the OpenCL event associated with the sync object changes to 28202f4aeb0Sopenharmony_ci CL_COMPLETE. 28302f4aeb0Sopenharmony_ci 28402f4aeb0Sopenharmony_ci Associating an OpenCL event handle with a sync object places a 28502f4aeb0Sopenharmony_ci reference on the linked OpenCL object. When the sync object is 28602f4aeb0Sopenharmony_ci deleted or the event handle is replaced, the reference will be 28702f4aeb0Sopenharmony_ci removed from the OpenCL object. 28802f4aeb0Sopenharmony_ci 28902f4aeb0Sopenharmony_ciIf EGL_KHR_reusable_sync is present, then for sync objects of type 29002f4aeb0Sopenharmony_ciEGL_SYNC_REUSABLE_KHR, the initial value of EGL_SYNC_STATUS may be 29102f4aeb0Sopenharmony_ciset to either EGL_UNSIGNALED or EGL_SIGNALED, and will default to 29202f4aeb0Sopenharmony_ciEGL_UNSIGNALED. 29302f4aeb0Sopenharmony_ci 29402f4aeb0Sopenharmony_ciIf EGL_ANDROID_native_fence_sync is present, then for native fence sync 29502f4aeb0Sopenharmony_ciobjects, the EGL_SYNC_NATIVE_FENCE_FD_ANDROID attribute may be specified 29602f4aeb0Sopenharmony_ciin eglUnsignalSyncEXT as well as eglCreateSync. If it is set to anything 29702f4aeb0Sopenharmony_ciother than EGL_NO_NATIVE_FENCE_FD_ANDROID at creation time, then its 29802f4aeb0Sopenharmony_ciinitial EGL_SYNC_STATUS will reflect the current status of the provided 29902f4aeb0Sopenharmony_cifence FD, and it is an error to specifically set the status. If it is 30002f4aeb0Sopenharmony_ciset to EGL_NO_NATIVE_FENCE_FD_ANDROID, then its EGL_SYNC_STATUS may be 30102f4aeb0Sopenharmony_ciset to either EGL_UNSIGNALED (the default) or EGL_SIGNALED. If the 30202f4aeb0Sopenharmony_cistatus is signaled, then no native fence will be generated until after 30302f4aeb0Sopenharmony_ciit is switched to unsignaled. If eglUnsignalSyncEXT is called for a 30402f4aeb0Sopenharmony_cinative fence sync object with an FD of EGL_NO_NATIVE_FENCE_FD_ANDROID, 30502f4aeb0Sopenharmony_cithen a new native fence will be generated at the next Flush(), as 30602f4aeb0Sopenharmony_cidescribed for eglCreateSync. 30702f4aeb0Sopenharmony_ci 30802f4aeb0Sopenharmony_ciIf EGL_NV_cuda_event is present, then for CUDA event sync objects, the 30902f4aeb0Sopenharmony_ciEGL_CUDA_EVENT_HANDLE_NV may be specified in eglUnsignalSyncEXT as well 31002f4aeb0Sopenharmony_cias eglCreateSync. The current CUDA event handle is evaluated at the time 31102f4aeb0Sopenharmony_cithe EGL sync object becomes unsignaled, and subsequent modification of 31202f4aeb0Sopenharmony_cithe CUDA object with cudaEventRecord has no effect on the sync object 31302f4aeb0Sopenharmony_ciuntil it is signaled. Subsequently restoring the sync object to 31402f4aeb0Sopenharmony_ciunsignaled will cause the CUDA object to be reevaluated. 31502f4aeb0Sopenharmony_ci 31602f4aeb0Sopenharmony_ciIssues 31702f4aeb0Sopenharmony_ci 31802f4aeb0Sopenharmony_ci 1. Should a new attribute be required to specify a sync object as 31902f4aeb0Sopenharmony_ci reusable? 32002f4aeb0Sopenharmony_ci 32102f4aeb0Sopenharmony_ci RESOLVED: No. The presence of this extension is sufficient to 32202f4aeb0Sopenharmony_ci indicate reusability of all sync objects. This will not create 32302f4aeb0Sopenharmony_ci any incompatibilities with existing applications that use sync 32402f4aeb0Sopenharmony_ci objects only once. 32502f4aeb0Sopenharmony_ci 32602f4aeb0Sopenharmony_ci 2. Can we leverage the existing eglSignalSyncKHR function from 32702f4aeb0Sopenharmony_ci EGL_KHR_reusable_sync for this extension? 32802f4aeb0Sopenharmony_ci 32902f4aeb0Sopenharmony_ci RESOLVED: No. Some types of sync objects require attributes 33002f4aeb0Sopenharmony_ci which are themselves single-use objects, and must be replaced 33102f4aeb0Sopenharmony_ci for the sync object to be reused. Therefore a new function which 33202f4aeb0Sopenharmony_ci takes an attribute list is required. 33302f4aeb0Sopenharmony_ci 33402f4aeb0Sopenharmony_ci 3. Should the function for unsignaling be based on eglSignalSyncKHR 33502f4aeb0Sopenharmony_ci from the KHR_reusable_sync extension, and take a mode parameter 33602f4aeb0Sopenharmony_ci to distinguish signaling/unsignaling? 33702f4aeb0Sopenharmony_ci 33802f4aeb0Sopenharmony_ci RESOLVED: No. While all sync objects will support unsignaling, 33902f4aeb0Sopenharmony_ci the reusable sync object is the only known one that supports 34002f4aeb0Sopenharmony_ci direct signaling, rather than signaling through some condition 34102f4aeb0Sopenharmony_ci being achieved. Therefore it is simplest to have the new 34202f4aeb0Sopenharmony_ci function only support unsignaling, and continue to use the old 34302f4aeb0Sopenharmony_ci extension for the one case where signaling is required. 34402f4aeb0Sopenharmony_ci 34502f4aeb0Sopenharmony_ci 4. If the initial attribute list is incomplete (e.g. an OpenCL 34602f4aeb0Sopenharmony_ci event handle is not provided during creation of an OpenCL event 34702f4aeb0Sopenharmony_ci sync object), should the EGL_SYNC_STATUS default to EGL_SIGNALED 34802f4aeb0Sopenharmony_ci rather than generating an error if it is left unspecified? 34902f4aeb0Sopenharmony_ci 35002f4aeb0Sopenharmony_ci RESOLVED: Handling of allowed/default values for EGL_SYNC_STATUS 35102f4aeb0Sopenharmony_ci is based on the sync type. For fence syncs, either value is 35202f4aeb0Sopenharmony_ci allowed, defaulting to EGL_UNSIGNALED. For OpenCL event syncs, 35302f4aeb0Sopenharmony_ci the value may not be specified, and instead is determined by 35402f4aeb0Sopenharmony_ci whether an OpenCL event is provided at creation time, and if so 35502f4aeb0Sopenharmony_ci by the status of that event. 35602f4aeb0Sopenharmony_ci 35702f4aeb0Sopenharmony_ciRevision History 35802f4aeb0Sopenharmony_ci 35902f4aeb0Sopenharmony_ci #4 (May 16, 2018) Daniel Kartch 36002f4aeb0Sopenharmony_ci - Minor corrections to wording 36102f4aeb0Sopenharmony_ci 36202f4aeb0Sopenharmony_ci #3 (April 20, 2018) Daniel Kartch 36302f4aeb0Sopenharmony_ci - Renamed to EXT 36402f4aeb0Sopenharmony_ci - Fixed grammatical errors and prepared for publication 36502f4aeb0Sopenharmony_ci 36602f4aeb0Sopenharmony_ci #2 (January 23, 2018) Daniel Kartch 36702f4aeb0Sopenharmony_ci - Rewrote some sections for clarity, and fixed typos 36802f4aeb0Sopenharmony_ci - Changed default/allowed behavior for signal state at creation 36902f4aeb0Sopenharmony_ci time to be determined by the sync type and other attributes. 37002f4aeb0Sopenharmony_ci - Simplified interaction with EGL_KHR_reusable_sync. 37102f4aeb0Sopenharmony_ci - Refined interaction with EGL_ANDROID_native_fence_sync to 37202f4aeb0Sopenharmony_ci clarify allowed initial states for the sync status and fix the 37302f4aeb0Sopenharmony_ci description of when new native fences are generated. 37402f4aeb0Sopenharmony_ci 37502f4aeb0Sopenharmony_ci #1 (January 16, 2018) Daniel Kartch 37602f4aeb0Sopenharmony_ci - Initial draft as XXX 377