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.
The entrypointExec address is modified before being passed to
clear_cache function. We do a small add/subtract for ARMv7 in
order to enable Thumb mode. This is not required for Aarch64 as
it does not support Thumb mode. Since we were not adding anything,
do not subtract as well before passing the address to clear_cache.
This was causing a crash while calling glXGetProcAddress.
We don't need to save and restore r12 across the call to _glapi_get_current.
It's only used for function linkage, and the dispatch stub overwrites the value
a few instructions later anyway.
We can't use a simple ld instruction for a slot greater than or equal to 4096,
because the offset no longer fits in the signed 16-bit offset field.
Instead, use an addis instruction to deal with the high-order bits in the
offset.
Call _glapi_get_current through the PLT call stub. The PLT call stub takes care
of saving the TOC pointer.
Also rearranged the assembly code to remove the need for a backwards jump after
calling _glapi_get_current.
In GL/gl.h, remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC, and the
GL_OES_EGL_image section.
PFNGLBLENDCOLORPROC and PFNGLBLENDEQUATIONPROC are defined in GL/glext.h in the
GL_VERSION_1_4 section.
GL_OES_EGL_image is defined in GLES/glext.h and GLES2/gl2ext.h, and the
GLeglImageOES typedef is also defined in GL/glext.h under
GL_EXT_EGL_image_storage.
This is important for testing the TSD stubs, which have a separate fast path
for single-threaded programs.
The TSD stubs start with a simple global variable to hold the dispatch table
so that a single-threaded program doesn't have to deal with the overhead of
calling pthread_getspecific. When a second thread comes along, it sets that
variable to NULL, which makes the stubs call pthread_getspecific instead.
This change adds a flag to the testgldispatch test program that tells it to
call into libGLdispatch from two threads to force it into its multi-threaded
mode.
It also adds three new test scripts, which are the same testgldispatch tests
but for the multithreaded path.
In __glDispatchCheckMultithreaded, don't unlock the mutex until after calling
stubCurrentPatchCb->threadAttach.
Without that lock, another thread could come along and change
stubCurrentPatchCb out from under it.