Commit graph

54 commits

Author SHA1 Message Date
Kyle Brenneman fd1df5e989 Update GL headers and XML files.
Update the GL headers and XML files to the Khronos repository, from
commit 11d7b7baebfc2b58116670cd17266f9c6a0d760b.
2022-08-23 07:30:18 -06:00
Kyle Brenneman 3144f287d1 Read gl.symbols when generating stubs for libGL.so.
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.
2022-06-07 07:57:02 -06:00
Alex Richardson 7fa33fac51 Update the EGL headers
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>
2022-02-06 17:53:55 +00:00
Kyle Brenneman db5ca3370c EGL: Add support for eglQueryDisplayAttribKHR and NV.
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.
2021-11-29 07:26:39 -07:00
Kyle Brenneman eaffa7bc12 EGL: Add a dispatch stub for eglQueryDisplayAttribEXT.
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.
2021-11-25 09:51:20 -07:00
Kyle Brenneman a7bb6f4d19 Remove extra paragraph from license text.
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
2021-09-30 09:21:34 -06:00
Kyle Brenneman b29f99d836 Update the EGL headers.
Updated the EGL headers and XML file to the Khronos repository, from commit
745e9ad435ad10323d0f42da1f279ad3cae2dba3.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/206
2021-08-23 17:24:53 -06:00
Simon Ser 418cbb6be3 egl: sync with Khronos
Updated the EGL headers and XML file to the Khronos repository, from commit
3dd5604d6791a0fdd102b665fe706ebf8737892b.
2021-07-22 16:35:01 +02:00
Kyle Brenneman f936adad89 generate: Use xml.etree.ElementTree instead of cElementTree.
The cElementTree module is deprecated as of 3.3, so use the normal ElementTree
module instead.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/204
2020-06-10 08:59:44 -06:00
Simon Ser 4acb9be27d
egl: sync with Khronos
Updated the EGL headers and XML file to the Khronos repository, from commit
90b78b0662e2f0548cfd1926fb77bf628933541b.
2020-05-07 23:36:13 +02:00
Eric Engestrom e77d52dadb egl/glx: avoid hard-coding the path to python 2019-12-12 23:47:24 +00:00
Eric Engestrom 0c38c8ad24 egl: drop shebang on non-executable script 2019-12-12 23:45:37 +00:00
Eric Engestrom f0c2ce450d Merge branch 'python' into 'master'
egl: misc python fixes

See merge request glvnd/libglvnd!218
2019-12-12 23:37:15 +00:00
Eric Engestrom 25024a1f0a egl: sort imports 2019-12-12 23:18:53 +00:00
Eric Engestrom 1f6b455dc8 egl: use ArgumentParser() instead of manually parsing sys.argv 2019-12-12 23:18:53 +00:00
Eric Engestrom 214450d18a egl: import eglFunctionList directly instead of passing it in the command line
`imp` is deprecated, and there's no reason to do things this complicated
when it's the only possibility.
2019-12-12 23:18:53 +00:00
Eric Engestrom 0ba59394e4 egl: use dedent() and consistent indentation in source code 2019-12-12 23:04:34 +00:00
Eric Engestrom 02f82033f1 egl: drop superfluous () in conditions 2019-12-12 23:04:34 +00:00
Eric Engestrom 8dd5f93faf egl: avoid comparing with the value of None 2019-12-12 23:04:34 +00:00
Eric Engestrom 679f40aa6e egl: #include <stddef.h> for NULL 2019-12-12 22:56:42 +00:00
Dylan Baker 16dc32352d Add meson build system
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
2019-12-05 12:01:36 -08:00
Kyle Brenneman fc32d56862 EGL: Fix two exported extension functions
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
2019-12-04 08:06:08 -07:00
Kyle Brenneman 7832167379 GLdispatch: Simplify the dispatch stub bookkeeping.
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.
2019-11-22 10:18:55 -07:00
Kyle Brenneman 86a9ed579b GLdispatch: Define dynamic dispatch stubs at compile time.
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.
2019-11-22 10:18:55 -07:00
Adam Jackson 51233cc52c egl: Sync with Khronos
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
2019-10-17 11:53:50 -04:00
Kyle Brenneman 6476491d4d Update the EGL headers.
Updated the EGL headers and XML file to the Khronos repository, from commit
598f20e3b7b7eec3e8d8a83e64b9592a21c55bb6.
2019-09-04 14:15:00 -06:00
Kyle Brenneman e67d3241c3 Update GL and GLX header and XML files.
Updated the OpenGL and GLX header and XML files to the Khronos repository, from
commit 08749e62826f34ba2e6e3733af545895f23e784b.
2019-09-03 09:22:52 -06:00
Kyle Brenneman 9d909106f2 Update the OpenGL XML and header files.
Update the gl.xml, GL/glext.h, and the GLES headers to commit
42f61786696df5102625d9b046976ee857645704 from the Khronos registry.
2018-06-20 15:57:00 -06:00
Kyle Brenneman adf997feb8 Move the glapi_gen_libglglxstubs function into the GL makefile.
Remove the now-empty file glvnd_gen.mk.
2018-03-26 14:40:57 -06:00
Kyle Brenneman 342cb23f22 Move the glapi_gen_mapi function into the vnd-glapi makefile.
$(glapi_gen_mapi) is only used in the vnd-glapi makefile, so define it there.
2018-03-26 14:40:52 -06:00
Kyle Brenneman 1578be92f2 generate: Remove glapi_gen_libopengl_exports.
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.
2018-03-26 14:40:50 -06:00
Michal Srb 37fc6caa4b Fix typo in _LIBRARY_FEATURE_NAMES.
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.
2017-08-14 15:28:41 +02:00
Kyle Brenneman d850cdde46 GL: Use a table to look up core GLX functions. (#127)
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.
2017-06-20 12:53:54 -06:00
Kyle Brenneman 839c97a410 GLdispatch: Remove _glapi_init_table_from_callback.
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.
2016-12-09 09:57:28 -07:00
Kyle Brenneman f544e43468 GLdispatch: Remove public_string_pool.
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.
2016-12-09 09:57:28 -07:00
Kyle Brenneman 0cea17eb04 Merge pull request #97 from aaronp24/master
Fix genCommon.py with Python 3
2016-10-31 14:42:32 -06:00
Aaron Plattner 996db4f2c2 chmod -x files that aren't scripts
These two files have mode 755, but aren't scripts that should be executed.
Remove their execute bits.
2016-10-25 16:08:35 -07:00
Aaron Plattner aa7c576c66 Don't use 'xrange' because Python 3 doesn't have it.
Apparently 'xrange' isn't a thing in Python 3. 'range' does the same thing and
works for both, so use that.
2016-10-06 13:57:42 -07:00
Kyle Brenneman 1cdf246082 EGL: Trim the dispatch stub list.
Reduce the dispatch stubs in EGL to only include core functions and client
extensions. Any other functions should be provided by the vendor libraries.
2016-08-01 13:06:18 -06:00
Kyle Brenneman 31c5e7f602 EGL: Implement EGL_KHR_debug.
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.
2016-06-22 16:15:32 -06:00
Kyle Brenneman b72018f59a EGL: Initial implementation of libEGL.
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.
2016-06-22 16:14:16 -06:00
Kyle Brenneman 65440c051e GLESv1: Statically export glPointSizePointerOES.
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.
2016-04-07 13:08:34 -06:00
Eric Engestrom 3c87d939aa Fix spelling mistakes 2016-04-03 16:14:15 +01:00
Emil Velikov db3a046fd4 configure.ac: make use of MKDIR_P macro
... 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>
2016-03-02 11:18:28 +00:00
Kyle Brenneman 59be159c9b Remove a bunch of unused files.
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.
2016-01-14 09:42:05 -07:00
Kyle Brenneman 4038efca1f Implement GLESv1.
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.
2015-11-20 14:44:25 -07:00
Kyle Brenneman 2e8f77c11b Implement GLESv2.
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.
2015-11-13 16:22:42 -07:00
Kyle Brenneman 41c8dc023b Generalize the export list generation scripts.
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.
2015-11-13 16:22:02 -07:00
Kyle Brenneman 63d95dda78 Remove the execute flags from gl.xml and glx.xml.
The XML files are obviously not executable, but the flag was set from when I
copied them from the Khronos SVN repository.
2015-11-11 11:17:56 -07:00
Kyle Brenneman 0626538361 libOpenGL.so: Only generate the entrypoints that we're going to export.
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.
2015-11-11 10:58:04 -07:00