102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci KHR_config_attribs 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_KHR_config_attribs 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContributors 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Jon Leech 1202f4aeb0Sopenharmony_ci 1302f4aeb0Sopenharmony_ciContacts 1402f4aeb0Sopenharmony_ci 1502f4aeb0Sopenharmony_ci Jon Leech (jon 'at' alumni.caltech.edu) 1602f4aeb0Sopenharmony_ci 1702f4aeb0Sopenharmony_ciNotice 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ci Copyright (c) 2006-2013 The Khronos Group Inc. Copyright terms at 2002f4aeb0Sopenharmony_ci http://www.khronos.org/registry/speccopyright.html 2102f4aeb0Sopenharmony_ci 2202f4aeb0Sopenharmony_ciStatus 2302f4aeb0Sopenharmony_ci 2402f4aeb0Sopenharmony_ci Complete 2502f4aeb0Sopenharmony_ci 2602f4aeb0Sopenharmony_ciVersion 2702f4aeb0Sopenharmony_ci 2802f4aeb0Sopenharmony_ci Version 5, April 5, 2007 2902f4aeb0Sopenharmony_ci 3002f4aeb0Sopenharmony_ciNumber 3102f4aeb0Sopenharmony_ci 3202f4aeb0Sopenharmony_ci EGL Extension #1 3302f4aeb0Sopenharmony_ci 3402f4aeb0Sopenharmony_ciDependencies 3502f4aeb0Sopenharmony_ci 3602f4aeb0Sopenharmony_ci Requires EGL 1.2 3702f4aeb0Sopenharmony_ci 3802f4aeb0Sopenharmony_ci Some of the extended config attributes defined by this extension are 3902f4aeb0Sopenharmony_ci only relevant when specific client APIs are supported. 4002f4aeb0Sopenharmony_ci 4102f4aeb0Sopenharmony_ci This extension is written against the wording of the EGL 1.2 4202f4aeb0Sopenharmony_ci Specification. It exists for backwards compatibility with 4302f4aeb0Sopenharmony_ci functionality introduced in EGL 1.3. 4402f4aeb0Sopenharmony_ci 4502f4aeb0Sopenharmony_ciOverview 4602f4aeb0Sopenharmony_ci 4702f4aeb0Sopenharmony_ci This extension adds new EGL config attributes and attribute bits 4802f4aeb0Sopenharmony_ci that express limitations of configs on a per-API basis, including 4902f4aeb0Sopenharmony_ci whether client APIs created with respect to a config are expected to 5002f4aeb0Sopenharmony_ci pass conformance, and which optional OpenVG color space and alpha 5102f4aeb0Sopenharmony_ci mask format attributes are valid at surface creation time. 5202f4aeb0Sopenharmony_ci 5302f4aeb0Sopenharmony_ciNew Types 5402f4aeb0Sopenharmony_ci 5502f4aeb0Sopenharmony_ci None 5602f4aeb0Sopenharmony_ci 5702f4aeb0Sopenharmony_ciNew Procedures and Functions 5802f4aeb0Sopenharmony_ci 5902f4aeb0Sopenharmony_ci None 6002f4aeb0Sopenharmony_ci 6102f4aeb0Sopenharmony_ciNew Tokens 6202f4aeb0Sopenharmony_ci 6302f4aeb0Sopenharmony_ci New EGLConfig bitmask attribute name: 6402f4aeb0Sopenharmony_ci 6502f4aeb0Sopenharmony_ci EGL_CONFORMANT_KHR 0x3042 6602f4aeb0Sopenharmony_ci 6702f4aeb0Sopenharmony_ci Valid bitfields in the EGL_SURFACE_TYPE bitmask attribute 6802f4aeb0Sopenharmony_ci of EGLConfig: 6902f4aeb0Sopenharmony_ci 7002f4aeb0Sopenharmony_ci EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 7102f4aeb0Sopenharmony_ci EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 7202f4aeb0Sopenharmony_ci 7302f4aeb0Sopenharmony_ciAdditions to Chapter 3 of the EGL 1.2 Specification (EGL Functions and Errors) 7402f4aeb0Sopenharmony_ci 7502f4aeb0Sopenharmony_ci Add to table 3.1, "EGLConfig attributes": 7602f4aeb0Sopenharmony_ci 7702f4aeb0Sopenharmony_ci Attribute Type Notes 7802f4aeb0Sopenharmony_ci --------- ---- ----- 7902f4aeb0Sopenharmony_ci EGL_CONFORMANT_KHR bitmask whether contexts created with 8002f4aeb0Sopenharmony_ci this config are conformant 8102f4aeb0Sopenharmony_ci 8202f4aeb0Sopenharmony_ci Add to table 3.2, "Types of surfaces supported by an EGLConfig": 8302f4aeb0Sopenharmony_ci 8402f4aeb0Sopenharmony_ci EGL Token Name Description 8502f4aeb0Sopenharmony_ci -------------- ----------- 8602f4aeb0Sopenharmony_ci EGL_VG_COLORSPACE_LINEAR_BIT_KHR EGLConfig supports OpenVG rendering 8702f4aeb0Sopenharmony_ci in linear colorspace 8802f4aeb0Sopenharmony_ci EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR EGLConfig supports OpenVG rendering 8902f4aeb0Sopenharmony_ci with premultiplied alpha 9002f4aeb0Sopenharmony_ci 9102f4aeb0Sopenharmony_ci Add following the second paragraph of "Other EGLConfig Attribute 9202f4aeb0Sopenharmony_ci Descriptions" in section 3.4 on p. 16: 9302f4aeb0Sopenharmony_ci 9402f4aeb0Sopenharmony_ci "If EGL_VG_COLORSPACE_LINEAR_BIT_KHR is set in EGL_SURFACE_TYPE, 9502f4aeb0Sopenharmony_ci then the EGL_COLORSPACE attribute may be set to 9602f4aeb0Sopenharmony_ci EGL_COLORSPACE_LINEAR when creating a window, pixmap, or pbuffer 9702f4aeb0Sopenharmony_ci surface (see section 3.5)." 9802f4aeb0Sopenharmony_ci 9902f4aeb0Sopenharmony_ci "If EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR is set in EGL_SURFACE_TYPE, 10002f4aeb0Sopenharmony_ci then the EGL_ALPHA_FORMAT attribute may be set to 10102f4aeb0Sopenharmony_ci EGL_ALPHA_FORMAT_PRE when creating a window, pixmap, or pbuffer 10202f4aeb0Sopenharmony_ci surface (see section 3.5)." 10302f4aeb0Sopenharmony_ci 10402f4aeb0Sopenharmony_ci Add at the end of the fourth paragraph (description of 10502f4aeb0Sopenharmony_ci EGL_CONFIG_CAVEAT) on p. 17: 10602f4aeb0Sopenharmony_ci 10702f4aeb0Sopenharmony_ci "... required OpenGL ES conformance tests (note that 10802f4aeb0Sopenharmony_ci EGL_NON_CONFORMANT_CONFIG is obsolete, and the same information 10902f4aeb0Sopenharmony_ci can be obtained from the EGL_CONFORMANT_KHR attribute on a 11002f4aeb0Sopenharmony_ci per-client-API basis, not just for OpenGL ES." 11102f4aeb0Sopenharmony_ci 11202f4aeb0Sopenharmony_ci "EGL_CONFORMANT_KHR is a mask indicating if a client API context 11302f4aeb0Sopenharmony_ci created with respect to the corresponding EGLConfig will pass 11402f4aeb0Sopenharmony_ci the required conformance tests for that API. The valid bit 11502f4aeb0Sopenharmony_ci settings are the same as for EGL_RENDERABLE_TYPE, as defined in 11602f4aeb0Sopenharmony_ci table 3.3, but the presence or absence of each client API bit 11702f4aeb0Sopenharmony_ci determines whether the corresponding context will be conformant 11802f4aeb0Sopenharmony_ci or non-conformant(fn1)." 11902f4aeb0Sopenharmony_ci 12002f4aeb0Sopenharmony_ci "(fn1) most EGLConfigs should be conformant for all supported 12102f4aeb0Sopenharmony_ci client APIs. Conformance requirements limit the number of 12202f4aeb0Sopenharmony_ci non-conformant configs that an implementation can define." 12302f4aeb0Sopenharmony_ci 12402f4aeb0Sopenharmony_ci Add to the last paragraph of section 3.5.1 on p. 24 (describing 12502f4aeb0Sopenharmony_ci eglCreateWindowSurface): 12602f4aeb0Sopenharmony_ci 12702f4aeb0Sopenharmony_ci "If <config> does not support the colorspace or alpha format 12802f4aeb0Sopenharmony_ci attributes specified in <attrib_list> (e.g. if EGL_COLORSPACE is 12902f4aeb0Sopenharmony_ci specified as EGL_COLORSPACE_LINEAR but the EGL_SURFACE_TYPE 13002f4aeb0Sopenharmony_ci attribute of <config> does not include 13102f4aeb0Sopenharmony_ci EGL_VG_COLORSPACE_LINEAR_BIT_KHR, or if EGL_ALPHA_FORMAT is 13202f4aeb0Sopenharmony_ci specified as EGL_ALPHA_FORMAT_PRE but EGL_SURFACE_TYPE does not 13302f4aeb0Sopenharmony_ci include EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR), an EGL_BAD_MATCH error 13402f4aeb0Sopenharmony_ci is generated." 13502f4aeb0Sopenharmony_ci 13602f4aeb0Sopenharmony_ci Add to the next-to-last paragraph of section 3.5.2 on p. 26 13702f4aeb0Sopenharmony_ci (describing eglCreatePbufferSurface): 13802f4aeb0Sopenharmony_ci 13902f4aeb0Sopenharmony_ci "If <config> does not support the colorspace or alpha format 14002f4aeb0Sopenharmony_ci attributes specified in <attrib_list> (as defined for 14102f4aeb0Sopenharmony_ci eglCreateWindowSurface), an EGL_BAD_MATCH error is generated." 14202f4aeb0Sopenharmony_ci 14302f4aeb0Sopenharmony_ci Add to the last paragraph of section 3.5.4 on p. 29 (describing 14402f4aeb0Sopenharmony_ci eglCreatePixmapSurface): 14502f4aeb0Sopenharmony_ci 14602f4aeb0Sopenharmony_ci "If <config> does not support the colorspace or alpha format 14702f4aeb0Sopenharmony_ci attributes specified in <attrib_list> (as defined for 14802f4aeb0Sopenharmony_ci eglCreateWindowSurface), an EGL_BAD_MATCH error is generated." 14902f4aeb0Sopenharmony_ci 15002f4aeb0Sopenharmony_ciIssues 15102f4aeb0Sopenharmony_ci 15202f4aeb0Sopenharmony_ci 1) How should colorspace and alpha format restrictions be specified? 15302f4aeb0Sopenharmony_ci OpenVG implementations may not allow linear colorspace or 15402f4aeb0Sopenharmony_ci premultiplied alpha rendering to all configs they support. 15502f4aeb0Sopenharmony_ci 15602f4aeb0Sopenharmony_ci RESOLVED: To maximize compatibility with EGL 1.3, we continue to 15702f4aeb0Sopenharmony_ci specify the desired colorspace and alpha format at surface 15802f4aeb0Sopenharmony_ci creation time. However, surface creation may fail if if the 15902f4aeb0Sopenharmony_ci specified colorspace or alpha format are not supported. 16002f4aeb0Sopenharmony_ci 16102f4aeb0Sopenharmony_ci To allow apps to detect this situation, this extension adds 16202f4aeb0Sopenharmony_ci EGLConfig attributes specifying *if* linear colorspace and/or 16302f4aeb0Sopenharmony_ci premultiplied alpha formats are supported. If they are not 16402f4aeb0Sopenharmony_ci supported, surface creation with the corresponding attributes 16502f4aeb0Sopenharmony_ci set will fail with an EGL_BAD_MATCH error. 16602f4aeb0Sopenharmony_ci 16702f4aeb0Sopenharmony_ci 2) How should the colorspace and alpha format capabilities be 16802f4aeb0Sopenharmony_ci exposed in EGLConfigs? 16902f4aeb0Sopenharmony_ci 17002f4aeb0Sopenharmony_ci RESOLVED: as bitfields of the existing EGL_SURFACE_TYPE bitmask 17102f4aeb0Sopenharmony_ci attribute. 17202f4aeb0Sopenharmony_ci 17302f4aeb0Sopenharmony_ci A separate bitmask might be more orthogonal, but there are 17402f4aeb0Sopenharmony_ci plenty of unused bits in EGL_SURFACE_TYPE and this minimizes API 17502f4aeb0Sopenharmony_ci and programming complexity. 17602f4aeb0Sopenharmony_ci 17702f4aeb0Sopenharmony_ci 3) Are support for linear colorspace and and premultiplied alpha 17802f4aeb0Sopenharmony_ci formats orthogonal? 17902f4aeb0Sopenharmony_ci 18002f4aeb0Sopenharmony_ci RESOLVED: Yes, according to the OpenVG Working Group. If they 18102f4aeb0Sopenharmony_ci were not orthogonal, we could not specify them as independent 18202f4aeb0Sopenharmony_ci bitfields. 18302f4aeb0Sopenharmony_ci 18402f4aeb0Sopenharmony_ci 4) Should information about conformance be specified on a 18502f4aeb0Sopenharmony_ci per-client-API basis? 18602f4aeb0Sopenharmony_ci 18702f4aeb0Sopenharmony_ci RESOLVED: Yes. This is needed for conformance testing and cannot 18802f4aeb0Sopenharmony_ci be expressed by the EGL_CONFIG_CAVEAT attribute, which is OpenGL 18902f4aeb0Sopenharmony_ci ES-specific. 19002f4aeb0Sopenharmony_ci 19102f4aeb0Sopenharmony_ci 5) Should there also be a config attribute which specifies whether 19202f4aeb0Sopenharmony_ci EGL_RENDER_BUFFER will be respected? 19302f4aeb0Sopenharmony_ci 19402f4aeb0Sopenharmony_ci UNRESOLVED: it would be consistent to add this attribute. but 19502f4aeb0Sopenharmony_ci it's not clear if there's a requirement for doing so yet. 19602f4aeb0Sopenharmony_ci 19702f4aeb0Sopenharmony_ci 6) Does this extension introduce a regression against EGL 1.2? 19802f4aeb0Sopenharmony_ci 19902f4aeb0Sopenharmony_ci RESOLVED: Yes. This is unavoidable, since we're allowing failure 20002f4aeb0Sopenharmony_ci of surface creation that was required to succeed in the past. 20102f4aeb0Sopenharmony_ci However, implementations that could not support the required 20202f4aeb0Sopenharmony_ci colorspace or alpha mask format were effectively non-conformant 20302f4aeb0Sopenharmony_ci (e.g. broken) in any event. The new EGL_SURFACE_TYPE attributes 20402f4aeb0Sopenharmony_ci at least allow apps to know that their request will not be 20502f4aeb0Sopenharmony_ci satisfied. 20602f4aeb0Sopenharmony_ci 20702f4aeb0Sopenharmony_ciDependencies on OpenGL ES 20802f4aeb0Sopenharmony_ci 20902f4aeb0Sopenharmony_ci If OpenGL ES is not supported, the EGL_OPENGL_ES_BIT in the 21002f4aeb0Sopenharmony_ci EGL_CONFORMANT_KHR is irrelevant. 21102f4aeb0Sopenharmony_ci 21202f4aeb0Sopenharmony_ciDependencies on OpenVG 21302f4aeb0Sopenharmony_ci 21402f4aeb0Sopenharmony_ci If OpenVG is not supported, the EGL_OPENVG_BIT bit in 21502f4aeb0Sopenharmony_ci EGL_CONFORMANT_KHR, and the EGL_VG_COLORSPACE_LINEAR_BIT_KHR and 21602f4aeb0Sopenharmony_ci EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR bits in EGL_SURFACE_TYPE, are 21702f4aeb0Sopenharmony_ci irrelevant. 21802f4aeb0Sopenharmony_ci 21902f4aeb0Sopenharmony_ciRevision History 22002f4aeb0Sopenharmony_ci 22102f4aeb0Sopenharmony_ci Version 5, 2007/04/05 - add enum values corresponding to EGL 1.3 22202f4aeb0Sopenharmony_ci core features. 22302f4aeb0Sopenharmony_ci Version 4, 2006/10/24 - prefix the bitfield names with "VG" to 22402f4aeb0Sopenharmony_ci clarify that they only apply to OpenVG rendering to surfaces 22502f4aeb0Sopenharmony_ci (although the corresponding core EGL_COLORSPACE and 22602f4aeb0Sopenharmony_ci EGL_ALPHA_FORMAT attribute names do not currently include this 22702f4aeb0Sopenharmony_ci prefix). Use "KHR" suffix instead of "OES". 22802f4aeb0Sopenharmony_ci Version 3, 2006/10/15 - add new config attribute to express whether 22902f4aeb0Sopenharmony_ci configs are conformant on a per-API basis. Correct sRGB 23002f4aeb0Sopenharmony_ci terminology to linear (sRGB is the default, linear colorspace 23102f4aeb0Sopenharmony_ci rendering may not be supported). Change extension name 23202f4aeb0Sopenharmony_ci accordingly. 23302f4aeb0Sopenharmony_ci Version 2, 2006/09/26 - add _OES extension suffix to bitfield names. 23402f4aeb0Sopenharmony_ci Version 1, 2006/09/26 - first draft. 235