Hash :
ba319ba3
Author :
Date :
2018-12-29T10:29:33
Re-land "Load entry points dynamically in tests and samples." Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL headers. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57 Reviewed-on: https://chromium-review.googlesource.com/c/1392382 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
The GLES 1.0 headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
Install Python 3 (not 2) with the lxml addon. You can do this using pip install lxml from your Python’s Scripts folder.
Edit OpenGL-Registry/xml/genheaders.py:
# GLES 1.x API + mandatory extensions - GLES/gl.h (no function pointers) prefixText = prefixStrings + gles1PlatformStrings + genDateCommentString, to prefixText = prefixStrings + gles1PlatformStrings + apiEntryPrefixStrings + genDateCommentString, genFuncPointers = False, to genFuncPointers = True, protectProto = False, to protectProto = 'nonzero', protectProtoStr = 'GL_GLEXT_PROTOTYPES', to protectProtoStr = 'GL_GLES_PROTOTYPES',
Set your working directory to OpenGL-Registry/xml/.
Run python genheaders.py ../api/GLES/gl.h
The generated header will now be in OpenGL-Registry/api/GLES/gl.h. You can copy the header over to this folder.
Also update scripts/gl.xml with the latest version from OpenGL-Registry/xml/.
# ANGLE GLES 1.0 Headers
The GLES 1.0 headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
### Regenerating gl.h
1. Install **Python 3** (not 2) with the **lxml** addon. You can do this using `pip install lxml` from your Python's Scripts folder.
1. Clone [https://github.com/KhronosGroup/OpenGL-Registry.git](https://github.com/KhronosGroup/OpenGL-Registry.git).
1. Edit `OpenGL-Registry/xml/genheaders.py`:
1. Look for the section titled `# GLES 1.x API + mandatory extensions - GLES/gl.h (no function pointers)`
1. Change `prefixText = prefixStrings + gles1PlatformStrings + genDateCommentString,` to `prefixText = prefixStrings + gles1PlatformStrings + apiEntryPrefixStrings + genDateCommentString,`
1. Change `genFuncPointers = False,` to `genFuncPointers = True,`
1. Change `protectProto = False,` to `protectProto = 'nonzero',`
1. Change `protectProtoStr = 'GL_GLEXT_PROTOTYPES',` to `protectProtoStr = 'GL_GLES_PROTOTYPES',`
1. Set your working directory to `OpenGL-Registry/xml/`.
1. Run `python genheaders.py ../api/GLES/gl.h`
1. The generated header will now be in `OpenGL-Registry/api/GLES/gl.h`. You can copy the header over to this folder.
1. Also update `scripts/gl.xml` with the latest version from `OpenGL-Registry/xml/`.