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.
Change glMakeCurrentTestResults to a GLX function instead of a GL function, so
that it can be dispatched using a vendor-provided stub instead of having to
generate one.
Remove the testglxmclate test, and the --late option in testglxmakecurrent,
since that only makes sense when MakeCurrentTestResults was a GL function.
Set the environment variable __GLX_FORCE_VENDOR_LIBRARY_0 for all of the GLX
tests instead of __GLX_VENDOR_LIBRARY_NAME.
Individual tests can force libGLX to load a vendor library early by calling
glXGetClientString or similar.
It now calls glXGetClientString up front to load the dummy vendor library. The
GLX entrypoint generation path has its own test now, so this test can now work
on builds without assembly support.
It now uses glXQueryServerString to test calling a core GLX function. That's a
better test because it returns a predictable value, so we can make sure that it
actually gets dispatched to the vendor library, instead of just checking that
it doesn't crash.
For testing looking up an OpenGL function, it'll call glXGetProcAddress and
directly call __glDispatchGetProcAddress, and make sure that it gets the same
pointer from both. It doesn't try to call the function, since OpenGL
dispatching has its own tests.
Added a separate test program testglxgetprocaddress_genentry to test the GLX
entrypoint generation by itself instead of lumping that in with
testglxgetprocaddress.
Define a new USE_DISPATCH_ASM macro in config.h if assembly dispatch stubs are
enabled. Update the GLX entrypoint generation to use that macro instead of
checking all of the USE_*_ASM macros.
This is less likely to break if we add assembly support for another
architecture. In addition, it'll make it easier to skip any unit tests
that depend on being able to generate new dispatch stubs.
The one in Mesa is empty but appears to come from some Khronos
repository, but gl3ext.h has never existed in the OpenGL-Registry
repository on github. Provide it for backwards compatibility.
Closes: https://gitlab.freedesktop.org/glvnd/libglvnd/issues/195
Add a .gitlab-ci.yml file to run libglvnd's unit tests.
The "build-distcheck" target will simply run "make distcheck". That should also
cover running the unit tests for the x86-64 TLS build.
The "build-i386", "build-i386-tsd", and "build-x86-64-tsd" targets will build
and test the x86 TLS and TSD builds and the x86-64 TSD build.
The pure C stubs aren't covered yet, but they'll be easy to add once the unit
tests are fixed for them.
ARM and PPC builds also aren't covered yet.
egl: Sync with Khronos
Update egl.h and egl.xml to upstream commit de3a5e867d906a04a5c37ee0d89e7f01d3598eb9.
Closes#193
See merge request glvnd/libglvnd!192
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
Because mesa can be built without glesv1 so it breaks autodetection.
Fixes: https://bugs.archlinux.org/task/64032 ('mesa-demos doesn't build, unable to find GLES/gl.h')
The behaviour of a relative `library_path` is deliberately left
unspecified here. As an implementation detail, it's currently
passed directly to `dlopen()`, so in practice it will be interpreted as
relative to the process's current working directory, but that doesn't
seem practically useful. Vulkan treats relative paths as being relative
to the JSON file in which they were found, which seems more likely to
be a helpful behaviour.
Otherwise this documents the current behaviour, without any of the
possible changes suggested on #187. If any of those changes are made,
then this document should be updated at the same time.
Signed-off-by: Simon McVittie <smcv@collabora.com>
The configure script now checks the environment variable GLDISPATCH_PAGE_SIZE.
If it's set, then it overrides the GLDISPATCH_PAGE_SIZE macro used in
libGLdispatch to align the assembly dispatch stubs.
This is mainly useful on ppc64le and aarch64 builds, where the page size can
vary.
Defining a target-specific CFLAGS variable overrides AM_CFLAGS, so add the same
include paths for the GLX tests that we used to add using AM_CFLAGS.
Also remove the -Wno-error flags, since they aren't needed anymore.
Add a new configure option, --disable-x11. That option will disable GLX, and
will #ifdef out the X11 platform detection in EGL, but also remove the
dependency on the X11 libraries and headers.
In addition, only check for the xext and glproto packages if GLX is enabled,
since that's the only component that needs them.
Since we've got pkg-config files for the various libraries, we should also
install the corresponding header files so that the include directory matches
up.
This preserves the names from Mesa's gl, glesv1_cm, glesv2, and egl pkgconfig
data, and for compatibility with that, gl.pc gives you libGL.
Also added glx.pc and opengl.pc for libglvnd's libGLX and libOpenGL libraries.
If newer applications want to explicitly depend on libGLX and the appropriate
rendering API they can ask for the new pkgconfig names.
Note that the version numbers in each file are the API versions that each
library exposes, not the libglvnd package version.