mirror of
https://github.com/utmapp/angle.git
synced 2026-12-06 02:12:05 -10:00
Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511 Reviewed-by: Yuly Novikov <[email protected]> Commit-Queue: Jamie Madill <[email protected]>
ANGLE EGL Headers
The EGL headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
Regenerating EGL.h
-
Install Python 3 (not 2) with the lxml addon. You can do this using
pip install lxmlfrom your Python's Scripts folder. -
Edit
EGL-Registry/api/genheaders.py:- Look for the section titled
# EGL API - EGL/egl.h (no function pointers, yet @@@) - Change
genFuncPointers = False,togenFuncPointers = True, - Change
protectProto = False,toprotectProto = 'nonzero', - Change
protectProtoStr = 'EGL_EGLEXT_PROTOTYPES',toprotectProtoStr = 'EGL_EGL_PROTOTYPES',
- Look for the section titled
-
Set your working directory to
EGL-Registry/api/. -
Run
python genheaders.py -registry egl.xml EGL/egl.h -
The generated header will now be in
EGL-Registry/api/EGL/egl.h. You can copy the header over to this folder. -
Also update
egl.xmlwith the latest version fromEGL-Registry/api/.