102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci ANGLE_sync_control_rate 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_ANGLE_sync_control_rate 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContact 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Jonah Ryan-Davis, Google (jonahr 'at' google.com) 1202f4aeb0Sopenharmony_ci 1302f4aeb0Sopenharmony_ciStatus 1402f4aeb0Sopenharmony_ci 1502f4aeb0Sopenharmony_ci Draft. 1602f4aeb0Sopenharmony_ci 1702f4aeb0Sopenharmony_ciVersion 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ci Version 1, 2020-03-24 2002f4aeb0Sopenharmony_ci 2102f4aeb0Sopenharmony_ci Based on GLX_OML_sync_control Revision 6.0 2202f4aeb0Sopenharmony_ci Related to EGL_CHROMIUM_sync_control Revision 2.0 2302f4aeb0Sopenharmony_ci 2402f4aeb0Sopenharmony_ciNumber 2502f4aeb0Sopenharmony_ci 2602f4aeb0Sopenharmony_ci 142 2702f4aeb0Sopenharmony_ci 2802f4aeb0Sopenharmony_ciDependencies 2902f4aeb0Sopenharmony_ci 3002f4aeb0Sopenharmony_ci The extension is written against the EGL 1.2 Specification, although it 3102f4aeb0Sopenharmony_ci should work on other versions of these specifications. 3202f4aeb0Sopenharmony_ci 3302f4aeb0Sopenharmony_ciOverview 3402f4aeb0Sopenharmony_ci 3502f4aeb0Sopenharmony_ci This extension provides counters which let applications know about the 3602f4aeb0Sopenharmony_ci timing of the last vertical retrace. By looking at the system clock, as 3702f4aeb0Sopenharmony_ci well as the refresh rate of the monitor, this should enable applications 3802f4aeb0Sopenharmony_ci to predict the position of future retraces so as to schedule an optimal 3902f4aeb0Sopenharmony_ci workload. 4002f4aeb0Sopenharmony_ci 4102f4aeb0Sopenharmony_ci This extension incorporates the use of a counter that provides the 4202f4aeb0Sopenharmony_ci necessary synchronization. The graphics Media Stream Counter (or 4302f4aeb0Sopenharmony_ci graphics MSC) is a counter that is unique to the graphics subsystem 4402f4aeb0Sopenharmony_ci and increments for each vertical retrace that occurs. 4502f4aeb0Sopenharmony_ci 4602f4aeb0Sopenharmony_ci By querying the MSC rate for a given surface, the application can 4702f4aeb0Sopenharmony_ci accurately predict the timing for the next vertical retraces and schedule 4802f4aeb0Sopenharmony_ci rendering accordingly. 4902f4aeb0Sopenharmony_ci 5002f4aeb0Sopenharmony_ciIssues 5102f4aeb0Sopenharmony_ci 5202f4aeb0Sopenharmony_ci None. 5302f4aeb0Sopenharmony_ci 5402f4aeb0Sopenharmony_ciIP Status 5502f4aeb0Sopenharmony_ci 5602f4aeb0Sopenharmony_ci No known issues. 5702f4aeb0Sopenharmony_ci 5802f4aeb0Sopenharmony_ciNew Procedures and Functions 5902f4aeb0Sopenharmony_ci 6002f4aeb0Sopenharmony_ci Bool eglGetMscRateANGLE(EGLDisplay* dpy, 6102f4aeb0Sopenharmony_ci EGLSurface surface, 6202f4aeb0Sopenharmony_ci int32_t* numerator, 6302f4aeb0Sopenharmony_ci int32_t* denominator) 6402f4aeb0Sopenharmony_ci 6502f4aeb0Sopenharmony_ciNew Tokens 6602f4aeb0Sopenharmony_ci 6702f4aeb0Sopenharmony_ci None 6802f4aeb0Sopenharmony_ci 6902f4aeb0Sopenharmony_ciAdditions to the EGL 1.3 Specification 7002f4aeb0Sopenharmony_ci 7102f4aeb0Sopenharmony_ci The graphics MSC value is incremented once for each screen refresh. 7202f4aeb0Sopenharmony_ci For a non-interlaced display, this means that the graphics MSC value 7302f4aeb0Sopenharmony_ci is incremented for each frame. For an interlaced display, it means 7402f4aeb0Sopenharmony_ci that it will be incremented for each field. For a multi-monitor 7502f4aeb0Sopenharmony_ci system, the monitor used to determine MSC is the one where the surface 7602f4aeb0Sopenharmony_ci is located. If the surface spans multiple monitors, the monitor used 7702f4aeb0Sopenharmony_ci to determine MSC is the one with the biggest coverage in pixels. 7802f4aeb0Sopenharmony_ci 7902f4aeb0Sopenharmony_ci eglGetMscRateANGLE returns the rate at which the MSC will be incremented 8002f4aeb0Sopenharmony_ci for the display associated with <dpy> and <surface>. The rate is expressed 8102f4aeb0Sopenharmony_ci in Hertz as <numerator> / <denominator>. If the MSC rate in Hertz is an 8202f4aeb0Sopenharmony_ci integer, then <denominator> will be 1 and <numerator> will be 8302f4aeb0Sopenharmony_ci the MSC rate. 8402f4aeb0Sopenharmony_ci 8502f4aeb0Sopenharmony_ciErrors 8602f4aeb0Sopenharmony_ci 8702f4aeb0Sopenharmony_ci The function eglGetMscRateANGLE returns FALSE on failure. 8802f4aeb0Sopenharmony_ci If <dpy> is not a valid EGLDisplay, EGL_BAD_DISPLAY is generated. 8902f4aeb0Sopenharmony_ci If <surface> is not a valid EGLSurface, EGL_BAD_SURFACE is generated. 9002f4aeb0Sopenharmony_ci If there is no current EGLContext, EGL_BAD_CONTEXT is generated. 9102f4aeb0Sopenharmony_ci 9202f4aeb0Sopenharmony_ciNew Implementation Dependent State 9302f4aeb0Sopenharmony_ci 9402f4aeb0Sopenharmony_ci None 9502f4aeb0Sopenharmony_ci 9602f4aeb0Sopenharmony_ciRevision History 9702f4aeb0Sopenharmony_ci 9802f4aeb0Sopenharmony_ci Version 1, 2020-03-24 (Jonah Ryan-Davis) 9902f4aeb0Sopenharmony_ci - Initial draft, based on GLX_OML_sync_control revision 6.0. 100