Instead of generating symbols for everything in gl.xml, read the symbol
list from src/GL/gl.symbols and only generate the functions listed
there.
That way, when new functions get added to gl.xml, we won't add any more
symbols in libGL.so.
To do that, if the target parameter to gen_gldispatch_mapi.py is a
filename, then it will read that file for symbols instead of calling
genCommon.getExportNamesFromRoots.
Also added a new genCommon.readSymbolsFile function, which is mostly
copied from symbols-check.py.
Updated the EGL headers and XML file to the Khronos repository, from commit
0997d5398d9de08ac012e7230d6546eb342c2939.
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
There are KHR, EXT, and NV versions of eglQueryDisplayAttrib, so add
support for all of them.
Define separate eglQueryDisplayAttribEXT, eglQueryDisplayAttribKHR, and
eglQueryDisplayAttribNV functions. They all call into the same common
function, with the only difference being the name passed to an error
callback.
When loading a vendor library, check for the vendor's
eglQueryDisplayAttrib using all three suffixes, and use whichever one is
available.
Add a dispatch stub for eglQueryDisplayAttribEXT, which updates the device
hashtable if the application queries EGL_DEVICE_EXT.
It's possible that eglQueryDisplayAttribEXT could return an EGLDeviceEXT handle
that wasn't returned by eglQueryDevicesEXT, so the dispatch stub needs to add
the handle to the device hashtable.
Remove the "If only executable code is distributed..." paragraph from
the license text. Everything now uses a normal MIT license.
The only code from Khronos that's included in libglvnd is the EGL/GL
header and XML files, which do not contain that paragraph.
Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/221
Theres a couple of things that this meson build system does differently
than autotools. It doesn't use a config.h file, it just puts #defines on
the command line with -D. It also does all of the code generation in the
generated folder, simply because it's simpler to do that.
On my 2 core / 4 thread KBL system:
autotools (no ccache):
sh -c "./autogen.sh&& ./configure && make -j6 check" 44.74s user 6.70s system 145% cpu 35.269 total
autotools (warm ccache):
sh -c "./autogen.sh&& ./configure && make -j6 check" 32.86s user 4.22s system 129% cpu 28.580 total
meson (no ccache):
sh -c "meson build; ninja -C build test" 23.48s user 3.71s system 236% cpu 11.487 total
meson (warm ccache)
sh -c "meson build; ninja -C build test" 16.06s user 2.31s system 210% cpu 8.727 total
Fix a bug in gen_egl_dispatch.py which caused libEGL.so to export two extension
functions, eglCreatePlatformWindowSurfaceEXT and
eglCreatePlatformPixmapSurfaceEXT.
Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/issues/196
Changed the interface in stub.h to work with function indexes instead of
mapi_stub pointers. The mapi_stub structure is now an internal detail in
stub.c.
The mapi_stub struct now only contains a name and a slot.
Removed the dynamic_stubs array. Instead, it just keeps an array of the
function names for each dynamic stub. It now looks up the function pointers
with entry_get_public, and the slot number is always equal to the index, so the
name is the only thing it needs to keep track of.
Instead of allocating pages of memory for the dynamic dispatch stubs, define
them at build time like the static stubs.
The dynamic stubs are identical to the static ones, so we can use the same code
to define both the static and dynamic stubs at compile time.
Removed entry_generate(). entry_generate_default_code is now only used to
restore entrypoints after patching.
Aside from simplifying things by not having a separate allocation for the
dynamic stubs, this should also allow the dispatch stubs to function properly
in both processes after a call to fork.
commit de3a5e867d906a04a5c37ee0d89e7f01d3598eb9
Author: Ken Russell <kbrussel@alum.mit.edu>
Date: Sat Oct 12 05:44:43 2019 -0700
Reserve enums 0x34A0..0x34AF for ANGLE project. (#93)
Closes: https://gitlab.freedesktop.org/glvnd/libglvnd/issues/193
Generating a symbol list for the entrypoint libraries used to be necessary when
we generated the same set of dispatch stubs in each library.
Since then, we only generate the stubs that each library is going to export, so
we don't need a separate export list anymore.
The missing comma caused the "GL_ES_VERSION_3_1" and "GL_ES_VERSION_3_2" to
concatenate into non-existing feature name. Symbols from gles 3.1 and 3.2 were
then missing in the generated files.
libGL.so now looks up the GLX core functions using a simple table, so that it
doesn't have the overhead of looking them up by name every time it's loaded.
Removed the (mutex != NULL) checks from __glXGLLoadGLXFunction, since it's no
longer called without a mutex.
Removed __glXWrapperInit, since it doesn't do anything anymore. Also removed the header file libgl.h, which only contained the declaration for __glXWrapperInit.
Removed _glapi_init_table_from_callback, and the script that generates it.
Instead, libGLdispatch.so just iterates over the stub list to find the name for
each function.
Also removed the struct definition for _glapi_table, since it's only used in
_glapi_init_table_from_callback. Everything else just treats it as an array
of pointers.
Changed the public_stubs array so that it includes the full name of each
function, including the "gl" prefix, so that it can pass that name to the
vendor's getProcAddress callback.
Changed stub_find_by_slot to use an array lookup instead of a linear search.
The mapi_stub struct now just keeps a pointer to the name of the stub, for both
static and dynamic stubs.
Removed the public_string_pool variable. Instead, the public_stubs array
has the function names inline.
Implemented the EGL_KHR_debug extension in libEGL.
Updated the error reporting throughout libEGL to call the debug callback.
This requires that all vendor libraries also support EGL_KHR_debug. The reason
is that the debug callback has to be called every time an EGL error is
generated, and vendor libraries are still responsible for keeping track of EGL
errors on their own.
libEGL should be able to cope with a vendor library that doens't support
EGL_KHR_debug, but if that vendor library is used, then the extension won't
work correctly.
The implementation is mostly based off of libGLX.
Unlike GLX, libEGL will load all vendor libraries up front. This is necessary
for dealing with eglGetPlatformDisplay, as well as many client extensions.
Dispatching EGL functions is generally simpler than GLX. All display extension
functions by definition can be dispatched based on an EGLDisplay handle, so
it doesn't need to provide lookup functions for contexts or surfaces, and
vendor libraries don't have to add any EGL objects to tracking.
Only OpenGL and OpenGL ES and a handful of client extensions are supported so
far.
Add GL_OES_point_size_array to the set of features and extensions that are
exported from libGLESv1_CM.so.
According to the OpenGL ES 1.1 spec, all required extensions are supposed to be
statically exported from the library. GL_OES_point_size_array is the only
required extension that defines any functions.
... as opposed to hardcoding it. While we're here tweak the whole
command to use the standard - AM_V_at and @D, as opposed to @ and dir $@
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Removed several header files that were copied from Mesa but aren't used in
libglvnd.
Removed everything under src/arch, also copied from Mesa but unused.
Added a Makefile to build libGLESv1_CM.so. It's copied and adapted from the one
for libOpenGL.so.
The GLESv1 library currently exports all of the core functions in gl.xml for
GLES version 1.0.
Added a Makefile to build libGLESv2.so. It's copied and adapted from the one
for libOpenGL.so.
The GLESv2 library currently exports all of the core functions in gl.xml for
GLES versions 2.0 through 3.2, inclusive.
In genCommon.py, change getLibOpenGLNamesFromRoots so that it accepts a target
parameter. Defined separate targets for each library, including libGLdispatch.
gen_libOpenGL_exports.py now takes a target parameter just like
gen_gldispatch_mapi.py does.
This is in preparation for adding function lists for the libGLES libraries.
gen_gldispatch_mapi.py now takes an extra parameter to specify which library
it's building, so that it can generate the correct function list for that
library. For libOpenGL.so, it will only generate the functions that it's going
to export.
Updated the makefiles for libOpenGL.so, libGL.so, and libGLdispatch.so to
generate the correct set of entrypoints for each library.
Moved the code to figure out the libOpenGL.so function names to genCommon.py.