Commit Graph

61 Commits

Author SHA1 Message Date
yes,i Do 05f75de586 Add support for loongarch64. 2022-09-20 14:05:14 +00:00
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
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 26d15a9f13 EGL: Allow vendor's dispatch stubs to update the EGL device map.
Export a new __EGLapiExports::setVendorForDevice function, which allows
dispatch stubs to update the device hashtable when something returns an
EGLDeviceEXT handle.

Bumped the ABI version number to 1.2.
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
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
q66 c31a7c06eb vnd-glapi: allow asm to be used on ELFv2 ppc64 big endian
These entry points are actually not little endian specific,
but they are specific to ELFv2 ABI. ELFv2 ABI can be used
on either little or big endian, and there are distributions
doing so (e.g. Void Linux, Adélie Linux) as well as other
OSes transitioning (FreeBSD).

These have been confirmed to work on a Power Mac G5 running
Void Linux.
2019-12-09 18:49:41 +01:00
Dylan Baker b308a876d3 autotools: Include meson.build and meson_options.txt in dist 2019-12-05 12:01:36 -08: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
Matt Turner f466835326 Provide an empty GLES3/gl3ext.h header
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
2019-11-06 17:41:08 -08:00
Kyle Brenneman 5dfdc5a6dc Update GL/gl.h to match Mesa.
Updated GL/gl.h to match the copy from Mesa at commit
a0829cf23b307ca44ab8c4505974fb7c8d71a35a.
2019-10-22 16:48:29 -06: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
Laurent Carlier 3a1fb32c3b Add a configure option to disable glesv1 or glesv2
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')
2019-10-08 16:34:16 +00:00
Eric Engestrom 6f52473dac include: install GL headers when GL is enabled
A typo made it depend on EGL instead.

Fixes: ab9b5fcc3b ("Install the GL/GLES/GLX/EGL header files.")
2019-09-30 16:08:37 +01:00
Kyle Brenneman 6b8d76bf4e Add a configure option for whether to install the GL headers.
Add a --disable-headers option, which tells it not to install the
GL/GLES/GLX/EGL header files.
2019-09-04 14:15:00 -06:00
Kyle Brenneman ab9b5fcc3b Install the GL/GLES/GLX/EGL header files.
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.
2019-09-04 14:15:09 -06:00
Kyle Brenneman e5a4edcf17 Add the missing GL and GLES headers.
Add copies of glcorearb.h, and of the GLES2 and GLES3 headers.
2019-09-04 14:15:00 -06: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 012fe39e79 Remove a couple of duplicate typedefs.
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.
2018-10-04 09:53:25 -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 652909fbff Some fixes for "make dist"
Don't point nonst_HEADERS or EXTRA_DIST at entire directories. That causes
"make dist" to include files that it shouldn't, such as configured makefiles
and .pyc files.

Also added a few generated header files to noinst_HEADERS.
2018-04-13 16:15:37 -06:00
Kyle Brenneman 71226b013c EGL: Allow vendor libraries to identify platforms for eglGetDisplay. (#124)
EGL: Allow vendor libraries to identify platforms for eglGetDisplay.

Add a new optional function __EGLapiImports::findNativeDisplayPlatform. Vendor
libraries can provide that function to identify the platform for the native
display passed to eglGetDisplay.

Reviewed-by: Emil Velikov emil.velikov@collabora.com
2017-06-20 12:50:40 -06:00
Kyle Brenneman e77d29a67c Makefile and structural changes for ppc64le support.
Added the files and makefile changes needed for adding support for ppc64le
dispatch stubs.

The actual assembly code still needs to be written, along with any other
arch-specific requirements for self-modifying code.

The new entry_ppc64le_*.c files are mostly based on the x86-64 files.

It still needs:
- Assembly code for OpenGL dispatch stubs in entry_ppc64le_tls.c,
  entry_ppc64le_tsd.c, or both.
- Assembly code for GLX dispatch stubs in glvnd_genentry.c.
- Assembly code for the entrypoint patching tests in patchentrypoints.c.
2017-04-24 11:49:02 -06:00
Kyle Brenneman 3d0ee810f1 GLdispatch: Add support for x32.
Implement TLS dispatch stubs for x32. The new x32 stubs are based on Mesa's
implementation, from Mesa commit 89458366585c34879b70110758bb4fd3acb62ce0.
2017-03-08 13:39:07 -07:00
Kyle Brenneman 522c601799 Add support for aarch64.
Add assembly code and stub generation for TSD stubs on aarch64.
2016-11-15 08:36:51 -07:00
Kyle Brenneman 3053b22f3e EGL: Change __EGLapiImports to use (void *) for function pointers.
Trying to cast between __eglMustCastToProperFunctionPointerType and other
function pointer types causes strict aliasing warnings on some compilers.

Instead, just use a simple (void *) type for retrieving function pointers from
a vendor library, like libGLX does.
2016-08-30 13:22:59 -06:00
Kyle Brenneman f42d89dd99 EGL: Rework the current rendering API.
libEGL will now forward calls to eglBindAPI to the vendor libraries.

Defined as part of the interface that libEGL only supports OpenGL and GLES.

This should simplify the task of porting a driver to EGL, since the eglBindAPI
behavior is closer to a non-glvnd driver.
2016-08-01 13:06:10 -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 3c97019e89 Checked in the EGL headers. 2016-06-22 16:13:35 -06:00
Eric Engestrom 3c87d939aa Fix spelling mistakes 2016-04-03 16:14:15 +01:00
Kyle Brenneman c5bcda3b84 GLX: Fix the version number macros.
Fix the reversed GLX_VENDOR_ABI_GET_MAJOR_VERSION and
GLX_VENDOR_ABI_GET_MINOR_VERSION macros.

Add individual #defines for libglvnd's major and minor version for better
readability.
2016-03-30 17:35:31 -06:00
Kyle Brenneman 95a5bfcdfb Merge pull request #74 from kbrenneman/libglx-abi-version-1.
Updates to libGLX vendor library interface.
2016-03-28 17:40:51 -06:00
Kyle Brenneman 86585e3bb0 GLX: A few more ABI fixes.
Fix the return type in the __GLX_MAIN_PROTO macro.

In GLX_dummy.c, check the major and minor version numbers like a real vendor
library might. In addition, GLX_dummy.c now keeps a pointer to the
__GLXapiExports struct instead of a copy of it.
2016-03-28 17:26:32 -06:00
Kyle Brenneman af2aeb0b42 Merge pull request #71 from evelikov/use-glproto
build: use system glproto headers
2016-03-21 14:47:05 -06:00
Kyle Brenneman 3a84276f63 GLX: Add the patch callbacks directly to __GLXapiImports.
Added the function pointers for entrypoint rewriting as members of
__GLXapiImports, instead of using a separate __GLdispatchPatchCallbacks
pointer.

Moved the __GLdispatchPatchCallbacks struct to GLdispatch.h.
2016-03-10 16:57:34 -07:00
Kyle Brenneman da7ae346e3 GLX: Change __glx_Main to use the libGLX-allocated __GLXapiImports table.
__glx_Main now takes a pointer to the __GLXapiImports struct and fills it in.

The __GLXapiImports struct is now allocated and zeroed by libGLX. This makes it
possible to add an optional element to the end of the struct without breaking
backward compatibility.
2016-03-10 16:11:47 -07:00
Kyle Brenneman 58d8dcaeb0 GLX: Change the __glx_Main function prototype.
Removed the vendorID and vendorName parameters from the __glx_Main function,
since neither one is useful to a vendor.

Instead, __glx_Main now takes the __GLXvendorInfo pointer as a parameter. We
can use that to look up any additional per-vendor information that might be
added in the future.
2016-03-03 11:11:11 -07:00
Kyle Brenneman 74f7b27b77 GLX: Change the ABI version number to a (major, minor) pair.
The version number for the libGLX vendor library interface now uses a major and
minor version number in the high- and low-order 16 bits.

The major version is used for changes that break existing vendor libraries, and
the minor version is for changes where existing vendor libraries will still
work.
2016-03-02 12:46:39 -07:00
Kyle Brenneman 82f731010b Update a comment in GLdispatchABI.h. 2016-03-02 11:08:33 -07:00
Kyle Brenneman f95e3ae00d GLdispatch: Change the stub type enums.
Removed the distinction between TSD and TLS stubs, since that doesn't matter to
a vendor library. There's now a single type for the x86 stubs and a single type
for the x86-64 stubs.

Added a separate type enum for normal ARM and thumb stubs. As with x86, there's
no distinction between TLS and TSD.

Changed the __GLDISPATCH_STUB_PURE_C enum to a more generic
__GLDISPATCH_STUB_UNKNOWN.

Also removed the internal ENTRY_* enums and changed everything to use the
__GLDISPATCH_STUB_* enums instead.
2016-02-29 13:50:40 -07:00
Kyle Brenneman ba1c58a558 Rename a couple of functions in the ABI's.
Renamed __GLdispatchPatchCallbacks::checkPatchSupported to isPatchSupported,
and renamed __GLXapiImports::checkSupportsScreen to isScreenSupported.
2016-02-29 13:50:39 -07:00
Kyle Brenneman 88807b95b9 GLX: Change the mapping functions to return a vendor directly.
Changed vendorFromContext, vendorFromFBConfig, and vendorFromDrawable to return
the vendor pointer as its return value instead of using a pointer.

Returning by pointer was necessary when the functions would also return a
screen number. But, GLX objects are now associated directly with a vendor,
not with any particular screen or display.
2016-02-29 13:50:38 -07:00
Kyle Brenneman e59233a1a9 GLX: Remove the XVisualInfo to vendor mapping.
Removed addScreenVisualMapping, removeScreenVisualMapping, and vendorFromVisual
from __GLXapiExports.

The XVisualInfo to vendor mapping is a no-op, since it just uses the screen number
to select a vendor.

It might be useful in the future at some point to provide a mechanism for
selecting between multiple vendors on a single X screen, but such an option
would more likely be used with the GLXFBConfig-based functions, not with the
XVisualInfo-based ones.
2016-02-29 13:50:36 -07:00
Kyle Brenneman b8e2cec4b4 GLX: Return failures from the addVendor*Mapping functions.
The addVendorContextMapping, addVendorFBConfigMapping, and
addVendorDrawableMapping functions in __GLXapiExports now return an int to
indicate success or failure.

Updated the various GLX functions so that they will deal with those failures.
In the case of context and drawable creations functions, it will call back into
the vendor library to destroy the object before returning.
2016-02-29 13:50:35 -07:00
Kyle Brenneman 233b274be1 Add a threadAttach callback for entrypoint patching.
The threadAttach callback is used so that a vendor library can go through any
thread initialization it needs to in order to deal with any later OpenGL calls.

This allows a vendor library to work around broken applications that try to
call OpenGL functions without a current context.
2016-02-29 13:50:34 -07:00
Emil Velikov 35ef968cab build: use system glproto headers
As pointed out with commit d5bc0866a8 "Check for glproto in
configure.ac" we want to rely on the upstream/distribution provided
package. Thus lets remove the in-tree copy.

Also make sure we use the headers (add the missing CFLAGS).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-02-29 14:46:32 +00:00
Kyle Brenneman 431ea8f709 Remove the GLVNDPthreadFuncs parameter from the lkdhash.h macros.
The macros in lkdhash.h now just use the __glvndPthreadFuncs table, instead of
taking a GLVNDPthreadFuncs parameter.

Reviewed-by: Andy Ritger <aritger@nvidia.com>
2016-02-25 12:54:17 -07:00