102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci  EXT_bind_to_front
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci  EGL_EXT_bind_to_front
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ci
1002f4aeb0Sopenharmony_ciContributors
1102f4aeb0Sopenharmony_ci
1202f4aeb0Sopenharmony_ci  Daniel Herring
1302f4aeb0Sopenharmony_ci
1402f4aeb0Sopenharmony_ciContacts
1502f4aeb0Sopenharmony_ci  
1602f4aeb0Sopenharmony_ci  Daniel Herring, Core Avionics & Industrial Inc., daniel dot herring at ch1group dot com
1702f4aeb0Sopenharmony_ci
1802f4aeb0Sopenharmony_ciStatus
1902f4aeb0Sopenharmony_ci
2002f4aeb0Sopenharmony_ci  Complete
2102f4aeb0Sopenharmony_ci
2202f4aeb0Sopenharmony_ciVersion
2302f4aeb0Sopenharmony_ci
2402f4aeb0Sopenharmony_ci  Version 1.0, February 21, 2017
2502f4aeb0Sopenharmony_ci
2602f4aeb0Sopenharmony_ciNumber
2702f4aeb0Sopenharmony_ci
2802f4aeb0Sopenharmony_ci  EGL Extension #121
2902f4aeb0Sopenharmony_ci
3002f4aeb0Sopenharmony_ciDependencies
3102f4aeb0Sopenharmony_ci
3202f4aeb0Sopenharmony_ci  Requires EGL 1.2.
3302f4aeb0Sopenharmony_ci
3402f4aeb0Sopenharmony_ciOverview
3502f4aeb0Sopenharmony_ci
3602f4aeb0Sopenharmony_ci  This extension allows for using double buffered Pbuffers for rendering to textures, by 
3702f4aeb0Sopenharmony_ci  allowing a new enumeration to be used in eglBindTexImage. EGL_FRONT_BUFFER_EXT is used
3802f4aeb0Sopenharmony_ci  to denote reading the textures data from the front buffer of a double buffered Pbuffer.
3902f4aeb0Sopenharmony_ci
4002f4aeb0Sopenharmony_ciNew Types
4102f4aeb0Sopenharmony_ci
4202f4aeb0Sopenharmony_ci  None
4302f4aeb0Sopenharmony_ci
4402f4aeb0Sopenharmony_ciNew Procedures and Functions
4502f4aeb0Sopenharmony_ci
4602f4aeb0Sopenharmony_ci  None
4702f4aeb0Sopenharmony_ci
4802f4aeb0Sopenharmony_ciNew Tokens
4902f4aeb0Sopenharmony_ci  
5002f4aeb0Sopenharmony_ci  EGL_FRONT_BUFFER_EXT          0x3464     
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ciModify Section 3.6.1 of the EGL 1.2 Specification, paragraph 1
5302f4aeb0Sopenharmony_ci  Add EGL_FRONT_BUFFER_EXT to list of acceptable values for buffer attribute.
5402f4aeb0Sopenharmony_ci
5502f4aeb0Sopenharmony_ciModify Section 3.6.2 of the EGL 1.2 Specification, paragraph 5
5602f4aeb0Sopenharmony_ci  Add EGL_FRONT_BUFFER_EXT to list of acceptable values for buffer attribute.
5702f4aeb0Sopenharmony_ci
5802f4aeb0Sopenharmony_ciModify Section 3.5.2 of the EGL 1.2 Specification, paragraph 4 
5902f4aeb0Sopenharmony_ci  Add EGL_RENDER_BUFFER to list of attributes which can be accepted in attrib_list.
6002f4aeb0Sopenharmony_ci  
6102f4aeb0Sopenharmony_ciAdd to Section 3.5.2 of the EGL 1.2 Specification
6202f4aeb0Sopenharmony_ci  EGL_RENDER_BUFFER specifies the number of color buffers which should be useable by the
6302f4aeb0Sopenharmony_ci  client API rendering to the Pbuffer. If its value is EGL_SINGLE_BUFFER, then there is 
6402f4aeb0Sopenharmony_ci  one color buffer the client APIs will render to directly. If its value is EGL_BACK_BUFFER,
6502f4aeb0Sopenharmony_ci  then there are at least two color buffers the client API can render to. eglSwapBuffers 
6602f4aeb0Sopenharmony_ci  is used to switch which color buffer is currently being rendered to. By default, all 
6702f4aeb0Sopenharmony_ci  client APIs should render into the back buffer. The default value of EGL_RENDER_BUFFER
6802f4aeb0Sopenharmony_ci  is EGL_SINGLE_BUFFER.
6902f4aeb0Sopenharmony_ci
7002f4aeb0Sopenharmony_ciModify Section 2.2.2 of the EGL 1.2 Specification, paragraph 2
7102f4aeb0Sopenharmony_ci    Pbuffer surfaces have a back buffer but no associated window, so the back buffer 
7202f4aeb0Sopenharmony_ci    need not be copied.
7302f4aeb0Sopenharmony_ci  Change to:
7402f4aeb0Sopenharmony_ci    Pbuffer surfaces have no associated window, and include a back buffer, used by 
7502f4aeb0Sopenharmony_ci    default, for rendering to by the client API. Pbuffers may have a front buffer 
7602f4aeb0Sopenharmony_ci    used during render to texture operations to provide a read only texture which may
7702f4aeb0Sopenharmony_ci    be used while the back buffer is being rendered to.
7802f4aeb0Sopenharmony_ci 
7902f4aeb0Sopenharmony_ciModify Section 3.5.6 
8002f4aeb0Sopenharmony_ci    Querying EGL RENDER BUFFER returns the buffer which client API rendering
8102f4aeb0Sopenharmony_ci    is requested to use. For a window surface, this is the same attribute value
8202f4aeb0Sopenharmony_ci    specified when the surface was created. For a Pbuffer surface, it is always
8302f4aeb0Sopenharmony_ci    EGL BACK BUFFER. For a pixmap surface, it is always EGL SINGLE BUFFER. To
8402f4aeb0Sopenharmony_ci    determine the actual buffer being rendered to by a context, call eglQueryContext
8502f4aeb0Sopenharmony_ci    (see section 3.7.4).
8602f4aeb0Sopenharmony_ci
8702f4aeb0Sopenharmony_ci  Change to:
8802f4aeb0Sopenharmony_ci    Querying EGL RENDER BUFFER returns the buffer which client API rendering
8902f4aeb0Sopenharmony_ci    is requested to use. For a window surface or Pbuffer surface, this is the 
9002f4aeb0Sopenharmony_ci    same attribute value specified when the surface was created. For a pixmap 
9102f4aeb0Sopenharmony_ci    surface, it is always EGL SINGLE BUFFER. To determine the actual buffer being
9202f4aeb0Sopenharmony_ci    rendered to by a context, call eglQueryContext (see section 3.7.4).
9302f4aeb0Sopenharmony_ci
9402f4aeb0Sopenharmony_ciRevision History
9502f4aeb0Sopenharmony_ci  Version 1.0, 21/02/2017 - Initial Version
9602f4aeb0Sopenharmony_ci  
9702f4aeb0Sopenharmony_ciQuestion:
9802f4aeb0Sopenharmony_ci  What if the implementation  already uses double buffering for single buffered PBuffers? 
9902f4aeb0Sopenharmony_ci  Such as when an implementation must insert a resolve to a texture instead of being 
10002f4aeb0Sopenharmony_ci  able to use the same memory.
10102f4aeb0Sopenharmony_ciAnswer:
10202f4aeb0Sopenharmony_ci  EGL_BACK_BUFFER would still refer to the resolved buffer. But in the case of the a 
10302f4aeb0Sopenharmony_ci  double buffer EGL_FRONT_BUFFER should be used to reference the resolved buffer instead
10402f4aeb0Sopenharmony_ci  of EGL_BACK_BUFFER as in this case the user has specified 2 buffers and knows they want 
10502f4aeb0Sopenharmony_ci  the resolved buffer.
10602f4aeb0Sopenharmony_ci  In the double buffer case where only a back draw and a front resolved buffer is used 
10702f4aeb0Sopenharmony_ci  the implementation may not support EGL_BACK_BUFFER and should generate an EGL_BAD_
10802f4aeb0Sopenharmony_ci  PARAMETER error when not supporting EGL_BACK_BUFFER texture binding.
109