Update to libepoxy 1.5.9. ok jsg@

pull/1/head
matthieu 2021-10-29 15:57:09 +00:00
parent aaf90e5fed
commit a585d6af39
18 changed files with 87 additions and 825 deletions

View File

@ -1,68 +0,0 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include/epoxy src
SUBDIRS += test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = epoxy.pc
registry_files = \
registry/egl.xml \
registry/gl.xml \
registry/glx.xml \
registry/wgl.xml \
$()
meson_build_files = \
meson_options.txt \
meson.build \
include/epoxy/meson.build \
src/meson.build \
test/meson.build \
doc/meson.build \
doc/Doxyfile.in \
cross/fedora-mingw64.txt \
$()
EXTRA_DIST = \
.dir-locals.el \
README.md \
autogen.sh \
epoxy.pc.in \
$(registry_files) \
$(meson_build_files) \
$()
dist-hook:
@if test -d "$(top_srcdir)/.git"; then \
echo Generating ChangeLog... ; \
( $(top_srcdir)/missing --run git log --stat ) > "$(top_srcdir)/ChangeLog.tmp" \
&& mv -f "$(top_srcdir)/ChangeLog.tmp" "$(top_distdir)/ChangeLog" \
|| ( rm -f "$(top_srcdir)/ChangeLog.tmp"; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git checkout is required to generate a ChangeLog >&2; \
fi

View File

@ -1,5 +1,8 @@
[![Build Status](https://travis-ci.org/anholt/libepoxy.svg?branch=master)](https://travis-ci.org/anholt/libepoxy)
[![Build status](https://ci.appveyor.com/api/projects/status/xv6y5jurt5v5ngjx/branch/master?svg=true)](https://ci.appveyor.com/project/ebassi/libepoxy/branch/master)
![Ubuntu](https://github.com/anholt/libepoxy/workflows/Ubuntu/badge.svg)
![macOS](https://github.com/anholt/libepoxy/workflows/macOS/badge.svg)
![MSVC Build](https://github.com/anholt/libepoxy/workflows/MSVC%20Build/badge.svg)
![MSYS2 Build](https://github.com/anholt/libepoxy/workflows/MSYS2%20Build/badge.svg)
[![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
Epoxy is a library for handling OpenGL function pointer management for
you.

View File

@ -1,16 +0,0 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir"
mkdir m4 || exit 1
autoreconf -v --install || exit $?
cd "$ORIGDIR" || exit $?
if test -z "$NOCONFIGURE"; then
exec "$srcdir/configure" "$@"
fi

View File

@ -1,275 +0,0 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libepoxy],
[1.5.4],
[https://github.com/anholt/libepoxy],
[libepoxy])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign -Wno-portability dist-xz no-dist-gzip tar-ustar subdir-objects])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen.
Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or,
depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CHECK_PROGS([PYTHON], [python3 python2 python])
# Initialize libtool
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SYS_LARGEFILE
AC_CHECK_HEADER([KHR/khrplatform.h],
[AC_DEFINE([HAVE_KHRPLATFORM_H], [1],
[Define to 1 if you have <KHR/khrplatform.h> (used for tests)]
)]
)
# OS X defaults to having -Wint-conversion ("warn when passing
# uintptr_t to a void *") by default. Kill that.
XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
AC_ARG_ENABLE([x11],
[AC_HELP_STRING([--enable-x11=@<:@yes,no@:>@], [Enable X11 support @<:@default=yes@:>@])],
[enable_x11=$enableval],
[enable_x11=yes])
AC_ARG_ENABLE([glx],
[AC_HELP_STRING([--enable-glx=@<:@auto,yes,no@:>@], [Enable GLX support @<:@default=auto@:>@])],
[enable_glx=$enableval],
[enable_glx=auto])
# GLX can be used on different platforms, so we expose a
# configure time switch to enable or disable it; in case
# the "auto" default value is set, we only enable GLX
# support on Linux and Unix
AS_CASE([$enable_glx],
[auto], [
AS_CASE([$host_os],
[mingw*], [build_glx=no],
[darwin*], [build_glx=no],
[android*], [build_glx=no],
[build_glx=yes])
],
[yes], [
build_glx=yes
],
[no], [
build_glx=no
],
[AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])]
])
AC_ARG_ENABLE([egl],
[AC_HELP_STRING([--enable-egl=@<:@auto,yes,no@:>@], [Enable EGL support @<:@default=auto@:>@])],
[enable_egl=$enableval],
[enable_egl=auto])
AS_CASE([$enable_egl],
[auto], [
AS_CASE([$host_os],
[mingw*], [build_egl=no],
[darwin*], [build_egl=no],
[build_egl=yes])
],
[yes], [
build_egl=yes
],
[no], [
build_egl=no
],
[AC_MSG_ERROR([Invalid value "$enable_egl" for option "--enable-egl"])]
])
# The remaining platform specific API are enabled depending on the
# platform we're building for
AS_CASE([$host_os],
[mingw*], [
build_wgl=yes
has_znow=yes
# On windows, the DLL has to have all of its functions
# resolved at link time, so we have to link directly against
# opengl32.dll. But that's the only GL provider, anyway.
EPOXY_LINK_LIBS="-lopengl32"
# Testing our built windows binaries requires that they be run
# under wine. Yeah, we should be nice and autodetect, but
# there's lots of missing autodetection for the testsuite
# (like checking for EGL and GLX libs in non-windows.).
AC_SUBST([LOG_COMPILER], [wine])
],
[darwin*], [
build_wgl=no
has_znow=no
EPOXY_LINK_LIBS=""
],
[
build_wgl=no
has_znow=yes
# On platforms with dlopen, we load everything dynamically and
# don't link against a specific window system or GL implementation.
EPOXY_LINK_LIBS=""
]
)
AC_SUBST(EPOXY_LINK_LIBS)
if test x$enable_x11 = xno; then
if test x$enable_glx = xyes; then
AC_MSG_ERROR([GLX support is explicitly enabled, but X11 was disabled])
fi
build_glx=no
else
AC_DEFINE([ENABLE_X11], [1], [Whether X11 support is enabled])
fi
AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes)
if test x$build_egl = xyes; then
PKG_CHECK_MODULES(EGL, [egl])
AC_DEFINE([BUILD_EGL], [1], [build EGL tests])
AC_DEFINE(ENABLE_EGL, [1], [Whether EGL support is enabled])
fi
AM_CONDITIONAL(BUILD_GLX, test x$build_glx = xyes)
if test x$build_glx = xyes; then
AC_DEFINE([BUILD_GLX], [1], [build GLX tests])
fi
AM_CONDITIONAL(BUILD_WGL, test x$build_wgl = xyes)
if test x$build_wgl = xyes; then
AC_DEFINE([BUILD_WGL], [1], [build WGL tests])
fi
AM_CONDITIONAL(HAS_ZNOW, test x$has_znow = xyes)
AC_CHECK_LIB([GLESv1_CM], [glFlush], [has_gles1=yes], [has_gles1=no])
AM_CONDITIONAL(HAS_GLES1, test x$has_gles1 = xyes)
AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])
AC_SUBST([DLOPEN_LIBS])
savelibs=$LIBS
LIBS=$DLOPEN_LIBS
AC_CHECK_FUNCS([dlvsym], [have_dlvsym=1], [have_dlvsym=0])
AM_CONDITIONAL(HAVE_DLVSYM, test $have_dlvsym = 1)
LIBS=$savelibs
VISIBILITY_CFLAGS=""
AS_CASE(["$host"],
[*-*-mingw*], [
dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
AC_DEFINE([EPOXY_PUBLIC],
[__attribute__((visibility("default"))) __declspec(dllexport) extern],
[defines how to decorate public symbols while building])
VISIBILITY_CFLAGS="-fvisibility=hidden"
],
[
dnl on other compilers, check if we can do -fvisibility=hidden
SAVED_CFLAGS="${CFLAGS}"
CFLAGS="-fvisibility=hidden"
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
AC_TRY_COMPILE([], [int main (void) { return 0; }], [
AC_MSG_RESULT(yes)
enable_fvisibility_hidden=yes
], [
AC_MSG_RESULT(no)
enable_fvisibility_hidden=no
])
CFLAGS="${SAVED_CFLAGS}"
AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
AC_DEFINE([EPOXY_PUBLIC],
[__attribute__((visibility("default"))) extern],
[defines how to decorate public symbols while building])
VISIBILITY_CFLAGS="-fvisibility=hidden"
])
]
)
AC_SUBST([VISIBILITY_CFLAGS])
if test x$enable_x11 = xyes; then
PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
if test x$x11 = xno -a x$build_glx = xyes; then
AC_MSG_ERROR([libX11 headers (libx11-dev) are required to build with GLX support])
fi
else
x11=no
fi
if test x$build_glx = xyes; then
AC_DEFINE(ENABLE_GLX, [1], [Whether GLX support is enabled])
fi
AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
PKG_CHECK_MODULES(EGL, [egl], [egl=yes], [egl=no])
GL_REQS=""
AS_IF([test x$gl = xyes], [GL_REQS="$GL_REQS gl"])
AS_IF([test x$build_egl = xyes && test x$egl = xyes], [GL_REQS="$GL_REQS egl"])
AC_SUBST(GL_REQS)
# Variables for the pkg-config file; AC_SUBST does not do `test` substitutions,
# so we need to specify the boolean values here
AS_IF([test x$build_glx = xyes], [epoxy_has_glx=1], [epoxy_has_glx=0])
AS_IF([test x$build_egl = xyes], [epoxy_has_egl=1], [epoxy_has_egl=0])
AS_IF([test x$build_wgl = xyes], [epoxy_has_wgl=1], [epoxy_has_wgl=0])
AC_SUBST(epoxy_has_glx)
AC_SUBST(epoxy_has_egl)
AC_SUBST(epoxy_has_wgl)
AC_CONFIG_FILES([
epoxy.pc
Makefile
include/epoxy/Makefile
src/Makefile
test/Makefile
])
AC_OUTPUT
echo " EGL: $build_egl"
echo " GLX: $build_glx"
echo " WGL: $build_wgl"
echo " PYTHON: $PYTHON"

View File

@ -1,42 +0,0 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
epoxyincludedir = $(includedir)/epoxy
epoxyinclude_HEADERS = \
common.h \
gl.h \
$(EGL_INCLUDES) \
$(GLX_INCLUDES) \
$(WGL_INCLUDES) \
$()
if BUILD_EGL
EGL_INCLUDES = egl.h
endif
if BUILD_GLX
GLX_INCLUDES = glx.h
endif
if BUILD_WGL
WGL_INCLUDES = wgl.h
endif

View File

@ -25,7 +25,6 @@ foreach g: generated_headers
input: registry,
output: [ gen_header ],
command: [
python,
gen_dispatch_py,
'--header',
'--no-source',

View File

@ -1,11 +1,11 @@
project('libepoxy', 'c', version: '1.5.4',
project('libepoxy', 'c', version: '1.5.9',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu99',
'warning_level=1',
],
license: 'MIT',
meson_version: '>= 0.47.0')
meson_version: '>= 0.54.0')
epoxy_version = meson.project_version().split('.')
epoxy_major_version = epoxy_version[0].to_int()
@ -196,14 +196,8 @@ if host_system == 'windows'
gdi32_dep = cc.find_library('gdi32', required: true)
endif
# Python
python = import('python3').find_python()
if not python.found()
python = find_program('python', required: true)
endif
# Generates the dispatch tables
gen_dispatch_py = files('src/gen_dispatch.py')
gen_dispatch_py = find_program('src/gen_dispatch.py')
gl_registry = files('registry/gl.xml')
egl_registry = files('registry/egl.xml')

View File

@ -1,184 +0,0 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
$()
AM_CFLAGS = \
$(CWARNFLAGS) \
$(VISIBILITY_CFLAGS) \
$(X11_CFLAGS) \
$(EGL_CFLAGS) \
$()
epoxyincludedir = $(includedir)/epoxy
lib_LTLIBRARIES = libepoxy.la
epoxyinclude_DATA = \
$(GENERATED_GL_INCLUDES) \
$(INSTALL_GLX_INCLUDES) \
$(INSTALL_EGL_INCLUDES) \
$(INSTALL_WGL_INCLUDES) \
$()
if BUILD_EGL
INSTALL_EGL_INCLUDES = $(GENERATED_EGL_INCLUDES)
endif
if BUILD_GLX
INSTALL_GLX_INCLUDES = $(GENERATED_GLX_INCLUDES)
endif
if BUILD_WGL
INSTALL_WGL_INCLUDES = $(GENERATED_WGL_INCLUDES)
endif
GENERATED_GL_INCLUDES = \
$(builddir)/../include/epoxy/gl_generated.h \
$()
GENERATED_GLX_INCLUDES = \
$(builddir)/../include/epoxy/glx_generated.h \
$()
GENERATED_EGL_INCLUDES = \
$(builddir)/../include/epoxy/egl_generated.h \
$()
GENERATED_WGL_INCLUDES = \
$(builddir)/../include/epoxy/wgl_generated.h \
$()
GENERATED_GL_SOURCE = gl_generated_dispatch.c
GENERATED_GL = \
$(GENERATED_GL_SOURCE) \
$(GENERATED_GL_INCLUDES) \
$()
GENERATED_GLX_SOURCE = glx_generated_dispatch.c
GENERATED_GLX = \
$(GENERATED_GLX_SOURCE) \
$(GENERATED_GLX_INCLUDES) \
$()
GENERATED_EGL_SOURCE = egl_generated_dispatch.c
GENERATED_EGL = \
$(GENERATED_EGL_SOURCE) \
$(GENERATED_EGL_INCLUDES) \
$()
GENERATED_WGL_SOURCE = wgl_generated_dispatch.c
GENERATED_WGL = \
$(GENERATED_WGL_SOURCE) \
$(GENERATED_WGL_INCLUDES) \
$()
BUILT_SOURCES = \
$(GENERATED_GL) \
$(GENERATED_GLX) \
$(GENERATED_EGL) \
$(GENERATED_WGL) \
$()
CLEANFILES = $(BUILT_SOURCES)
libepoxy_la_SOURCES = \
dispatch_common.c \
dispatch_common.h \
$(GENERATED_GL) \
$(BUILD_EGL_CODE) \
$(BUILD_GLX_CODE) \
$(BUILD_WGL_CODE) \
$()
libepoxy_la_LDFLAGS = \
-no-undefined \
-Bsymbolic-functions \
$()
libepoxy_la_LIBADD = \
$(EPOXY_LINK_LIBS) \
$(DLOPEN_LIBS) \
$()
if BUILD_EGL
BUILD_EGL_CODE = \
$(GENERATED_EGL) \
dispatch_egl.c \
$()
endif
if BUILD_GLX
BUILD_GLX_CODE = \
$(GENERATED_GLX) \
dispatch_glx.c \
$()
endif
if BUILD_WGL
BUILD_WGL_CODE = \
$(GENERATED_WGL) \
dispatch_wgl.c \
$()
endif
# These are generated alongside the .c file.
$(GENERATED_GL_INCLUDES): $(GENERATED_GL_SOURCE)
$(GENERATED_GLX_INCLUDES): $(GENERATED_GLX_SOURCE)
$(GENERATED_EGL_INCLUDES): $(GENERATED_EGL_SOURCE)
$(GENERATED_WGL_INCLUDES): $(GENERATED_WGL_SOURCE)
$(GENERATED_GL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/gl.xml
@$(MKDIR_P) $(top_builddir)/include/epoxy
$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
--srcdir $(top_builddir)/src \
--includedir $(top_builddir)/include/epoxy \
$(top_srcdir)/registry/gl.xml
$(GENERATED_GLX_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/glx.xml
@$(MKDIR_P) $(top_builddir)/include/epoxy
$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
--srcdir $(top_builddir)/src \
--includedir $(top_builddir)/include/epoxy \
$(top_srcdir)/registry/glx.xml
$(GENERATED_EGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/egl.xml
@$(MKDIR_P) $(top_builddir)/include/epoxy
$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
--srcdir $(top_builddir)/src \
--includedir $(top_builddir)/include/epoxy \
$(top_srcdir)/registry/egl.xml
$(GENERATED_WGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/wgl.xml
@$(MKDIR_P) $(top_builddir)/include/epoxy
$(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \
--srcdir $(top_builddir)/src \
--includedir $(top_builddir)/include/epoxy \
$(top_srcdir)/registry/wgl.xml
EXTRA_DIST = \
gen_dispatch.py \
$()

View File

@ -399,10 +399,10 @@ epoxy_is_desktop_gl(void)
}
static int
epoxy_internal_gl_version(GLenum version_string, int error_version)
epoxy_internal_gl_version(GLenum version_string, int error_version, int factor)
{
const char *version = (const char *)glGetString(version_string);
GLint major, minor, factor;
GLint major, minor;
int scanf_count;
if (!version)
@ -420,11 +420,6 @@ epoxy_internal_gl_version(GLenum version_string, int error_version)
abort();
}
if (minor >= 10)
factor = 100;
else
factor = 10;
return factor * major + minor;
}
@ -446,7 +441,7 @@ epoxy_internal_gl_version(GLenum version_string, int error_version)
int
epoxy_gl_version(void)
{
return epoxy_internal_gl_version(GL_VERSION, 0);
return epoxy_internal_gl_version(GL_VERSION, 0, 10);
}
int
@ -455,7 +450,7 @@ epoxy_conservative_gl_version(void)
if (api.begin_count)
return 100;
return epoxy_internal_gl_version(GL_VERSION, 100);
return epoxy_internal_gl_version(GL_VERSION, 100, 10);
}
/**
@ -478,7 +473,7 @@ epoxy_glsl_version(void)
{
if (epoxy_gl_version() >= 20 ||
epoxy_has_gl_extension ("GL_ARB_shading_language_100"))
return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0);
return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0, 100);
return 0;
}
@ -682,13 +677,28 @@ epoxy_load_gl(void)
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, true, true);
#else
// Prefer GLX_LIB over OPENGL_LIB to maintain existing behavior.
// Using the inverse ordering OPENGL_LIB -> GLX_LIB, causes issues such as:
// https://github.com/anholt/libepoxy/issues/240 (apitrace missing calls)
// https://github.com/anholt/libepoxy/issues/252 (Xorg boot crash)
get_dlopen_handle(&api.glx_handle, GLX_LIB, false, true);
api.gl_handle = api.glx_handle;
#if defined(OPENGL_LIB)
if (!api.gl_handle)
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true);
get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true);
if (!api.gl_handle) {
fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB);
abort();
}
#else
if (!api.gl_handle) {
fprintf(stderr, "Couldn't open %s\n", GLX_LIB);
abort();
}
#endif
get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true);
api.gl_handle = api.glx_handle;
#endif
}

View File

@ -47,9 +47,12 @@
#endif
#if PLATFORM_HAS_EGL
# if !ENABLE_X11
/* Mesa uses this symbol to avoid including X11 headers when including
* EGL.h; since X11 was explicitly disabled at configuration time, we
* should do the same
/* Disable including X11 headers if the X11 support was disabled at
* configuration time
*/
# define EGL_NO_X11 1
/* Older versions of Mesa use this symbol to achieve the same result
* as EGL_NO_X11
*/
# define MESA_EGL_NO_X11_HEADERS 1
# endif

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2013 Intel Corporation
@ -466,6 +467,7 @@ class Generator(object):
func.args_decl))
def write_header_header(self, out_file):
self.close()
self.out_file = open(out_file, 'w')
self.outln('/* GL dispatch header.')
@ -514,9 +516,17 @@ class Generator(object):
self.outln('typedef uint32_t khronos_uint32_t;')
self.outln('typedef uint64_t khronos_uint64_t;')
self.outln('typedef float khronos_float_t;')
self.outln('typedef long khronos_intptr_t;')
self.outln('typedef long khronos_ssize_t;')
self.outln('typedef unsigned long khronos_usize_t;')
self.outln('#ifdef _WIN64')
self.outln('typedef signed long long int khronos_intptr_t;')
self.outln('typedef unsigned long long int khronos_uintptr_t;')
self.outln('typedef signed long long int khronos_ssize_t;')
self.outln('typedef unsigned long long int khronos_usize_t;')
self.outln('#else')
self.outln('typedef signed long int khronos_intptr_t;')
self.outln('typedef unsigned long int khronos_uintptr_t;')
self.outln('typedef signed long int khronos_ssize_t;')
self.outln('typedef unsigned long int khronos_usize_t;')
self.outln('#endif')
self.outln('typedef uint64_t khronos_utime_nanoseconds_t;')
self.outln('typedef int64_t khronos_stime_nanoseconds_t;')
self.outln('#define KHRONOS_MAX_ENUM 0x7FFFFFFF')
@ -525,7 +535,6 @@ class Generator(object):
self.outln(' KHRONOS_TRUE = 1,')
self.outln(' KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM')
self.outln('} khronos_boolean_enum_t;')
self.outln('typedef uintptr_t khronos_uintptr_t;')
if self.target == "glx":
self.outln('#include <X11/Xlib.h>')
@ -756,6 +765,7 @@ class Generator(object):
self.outln('')
def write_source(self, f):
self.close()
self.out_file = open(f, 'w')
self.outln('/* GL dispatch code.')
@ -848,6 +858,12 @@ class Generator(object):
for func in self.sorted_functions:
self.write_function_pointer(func)
def close(self):
if self.out_file:
self.out_file.close()
self.out_file = None
argparser = argparse.ArgumentParser(description='Generate GL dispatch wrappers.')
argparser.add_argument('files', metavar='file.xml', nargs='+', help='GL API XML files to be parsed')
argparser.add_argument('--outputdir', metavar='dir', required=False, help='Destination directory for files (default to current dir)')
@ -912,3 +928,5 @@ for f in args.files:
generator.write_header(os.path.join(includedir, name + '_generated.h'))
if build_source:
generator.write_source(os.path.join(srcdir, name + '_generated_dispatch.c'))
generator.close()

View File

@ -33,7 +33,6 @@ foreach g: generated_sources
input: registry,
output: [ gen_source ],
command: [
python,
gen_dispatch_py,
'--source',
'--no-header',
@ -54,9 +53,7 @@ if host_system == 'linux' and cc.get_id() == 'gcc'
endif
# Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108
if host_system == 'darwin'
common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ]
endif
darwin_versions = [1, '1.0']
epoxy_deps = [ dl_dep, ]
if host_system == 'windows'
@ -67,6 +64,7 @@ libepoxy = library(
'epoxy',
sources: epoxy_sources + epoxy_headers,
version: '0.0.0',
darwin_versions: darwin_versions,
install: true,
dependencies: epoxy_deps,
include_directories: libepoxy_inc,
@ -74,17 +72,22 @@ libepoxy = library(
link_args: common_ldflags,
)
epoxy_has_glx = build_glx ? '1' : '0'
epoxy_has_egl = build_egl ? '1' : '0'
epoxy_has_wgl = build_wgl ? '1' : '0'
libepoxy_dep = declare_dependency(
link_with: libepoxy,
include_directories: libepoxy_inc,
dependencies: epoxy_deps,
sources: epoxy_headers,
variables: {
'epoxy_has_glx': epoxy_has_glx,
'epoxy_has_egl': epoxy_has_egl,
'epoxy_has_wgl': epoxy_has_wgl,
},
)
epoxy_has_glx = build_glx ? '1' : '0'
epoxy_has_egl = build_egl ? '1' : '0'
epoxy_has_wgl = build_wgl ? '1' : '0'
# We don't want to add these dependencies to the library, as they are
# not needed when building Epoxy; we do want to add them to the generated
# pkg-config file, for consumers of Epoxy

View File

@ -1,192 +0,0 @@
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
EPOXY = $(builddir)/../src/libepoxy.la
check_LTLIBRARIES = \
$(EGL_UTIL_LIB) \
$(GLX_UTIL_LIB) \
$(WGL_UTIL_LIB) \
$()
libegl_common_la_SOURCES = \
egl_common.c \
egl_common.h
$()
libglx_common_la_SOURCES = \
glx_common.c \
glx_common.h
$()
libwgl_common_la_SOURCES = \
wgl_common.c \
wgl_common.h
$()
libwgl_common_la_LIBADD = $(EPOXY)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
$(X11_CFLAGS) \
$(EGL_CFLAGS) \
$()
AM_CFLAGS = $(CWARNFLAGS)
TESTS = \
$(EGL_TESTS) \
$(GLX_TESTS) \
$(EGL_AND_GLX_TESTS) \
$(WGL_TESTS) \
gl_version$(EXEEXT) \
headerguards$(EXEEXT) \
miscdefines$(EXEEXT) \
khronos_typedefs$(EXEEXT) \
$()
check_BINARIES = $(EGL_AND_GLX_BIN)
XFAIL_TESTS = \
$()
check_PROGRAMS = $(TESTS)
if BUILD_EGL
EGL_TESTS = \
$()
if HAVE_X11
EGL_TESTS += \
egl_has_extension_nocontext \
egl_epoxy_api \
egl_gles2_without_glx \
$()
if HAS_GLES1
EGL_TESTS += egl_gles1_without_glx
endif
EGL_UTIL_LIB = libegl_common.la
endif
endif
if BUILD_GLX
if HAS_ZNOW
GLX_SHARED_ZNOW = glx_shared_znow
endif
if BUILD_EGL
if BUILD_GLX
if HAVE_DLVSYM
EGL_AND_GLX_TESTS = \
egl_gl \
$()
endif
endif
endif
if HAVE_DLVSYM
GLX_DLVSYM_TESTS = \
glx_alias_prefer_same_name \
glx_gles2 \
$()
endif
GLX_TESTS = \
glx_beginend \
glx_public_api \
glx_public_api_core \
glx_glxgetprocaddress_nocontext \
glx_has_extension_nocontext \
glx_static \
$(GLX_SHARED_ZNOW) \
$(GLX_DLVSYM_TESTS) \
$()
GLX_UTIL_LIB = libglx_common.la
endif
if BUILD_WGL
WGL_TESTS = \
wgl_core_and_exts$(EXEEXT) \
wgl_per_context_funcptrs$(EXEEXT) \
wgl_usefontbitmaps$(EXEEXT) \
wgl_usefontbitmaps_unicode$(EXEEXT) \
$()
WGL_UTIL_LIB = libwgl_common.la
endif
egl_has_extension_nocontext_LDADD = $(EPOXY) libegl_common.la $(X11_LIBS)
egl_epoxy_api_LDADD = $(EPOXY) libegl_common.la $(X11_LIBS)
egl_gl_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS)
egl_gles1_without_glx_CPPFLAGS = $(AM_CPPFLAGS) -DGLES_VERSION=1
egl_gles1_without_glx_SOURCES = egl_without_glx.c
egl_gles1_without_glx_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS)
egl_gles2_without_glx_CPPFLAGS = $(AM_CPPFLAGS) -DGLES_VERSION=2
egl_gles2_without_glx_SOURCES = egl_without_glx.c
egl_gles2_without_glx_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS)
glx_alias_prefer_same_name_SOURCES = glx_alias_prefer_same_name.c dlwrap.c dlwrap.h
glx_alias_prefer_same_name_LDFLAGS = -rdynamic
glx_alias_prefer_same_name_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) $(DLOPEN_LIBS)
glx_beginend_LDADD = $(EPOXY) libglx_common.la $(GL_LIBS) $(X11_LIBS)
glx_gles2_SOURCES = glx_gles2.c dlwrap.c dlwrap.h
glx_gles2_LDFLAGS = -rdynamic
glx_gles2_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) $(DLOPEN_LIBS)
glx_public_api_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS)
glx_public_api_core_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS)
glx_glxgetprocaddress_nocontext_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS)
glx_has_extension_nocontext_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS)
glx_static_CFLAGS = -DNEEDS_TO_BE_STATIC
glx_static_LDADD = $(DLOPEN_LIBS) $(EPOXY) libglx_common.la $(X11_LIBS)
glx_static_LDFLAGS = -static
glx_shared_znow_SOURCES = glx_static.c
glx_shared_znow_LDADD = $(DLOPEN_LIBS) $(EPOXY) libglx_common.la $(X11_LIBS)
glx_shared_znow_LDFLAGS = -Wl,-z,now
khronos_typedefs_SOURCES = \
khronos_typedefs.c \
khronos_typedefs.h \
khronos_typedefs_nonepoxy.c \
$()
wgl_core_and_exts_LDADD = $(EPOXY) libwgl_common.la -lgdi32
wgl_per_context_funcptrs_LDADD = $(EPOXY) libwgl_common.la -lgdi32
wgl_usefontbitmaps_LDADD = $(EPOXY) libwgl_common.la -lgdi32
wgl_usefontbitmaps_unicode_SOURCES = wgl_usefontbitmaps.c
wgl_usefontbitmaps_unicode_LDADD = $(EPOXY) libwgl_common.la -lgdi32
wgl_usefontbitmaps_unicode_CPPFLAGS = $(AM_CPPFLAGS) -DUNICODE

View File

@ -29,7 +29,7 @@ GLenum mock_enum;
const char *mock_gl_version;
const char *mock_glsl_version;
static const GLubyte *override_glGetString(GLenum name)
static const GLubyte * EPOXY_CALLSPEC override_glGetString(GLenum name)
{
switch (name) {
case GL_VERSION:
@ -80,6 +80,8 @@ main(int argc, char **argv)
pass = pass && test_version("3.0 Mesa 13.0.6", 30,
"1.30", 130);
pass = pass && test_version("OpenGL ES 2.0 Mesa 20.1.0-devel (git-4bb19a330e)", 20,
"OpenGL ES GLSL ES 1.0.16", 100);
pass = pass && test_version("OpenGL ES 3.2 Mesa 18.3.0-devel", 32,
"OpenGL ES GLSL ES 3.20", 320);
pass = pass && test_version("4.5.0 NVIDIA 384.130", 45,

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.9 2020/01/26 13:45:49 matthieu Exp $
# $OpenBSD: Makefile,v 1.10 2021/10/29 15:57:09 matthieu Exp $
.include <bsd.xconf.mk>
EPOXY= ${.CURDIR}/../../dist/libepoxy
@ -7,7 +7,7 @@ LIB= epoxy
EPOXY_MAJOR= 1
EPOXY_MINOR= 5
EPOXY_TINY= 4
EPOXY_TINY= 9
INCSDIR= ${X11BASE}/include/epoxy

View File

@ -32,9 +32,17 @@ typedef uint16_t khronos_uint16_t;
typedef uint32_t khronos_uint32_t;
typedef uint64_t khronos_uint64_t;
typedef float khronos_float_t;
typedef long khronos_intptr_t;
typedef long khronos_ssize_t;
typedef unsigned long khronos_usize_t;
#ifdef _WIN64
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
typedef uint64_t khronos_utime_nanoseconds_t;
typedef int64_t khronos_stime_nanoseconds_t;
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
@ -43,7 +51,6 @@ typedef enum {
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
typedef uintptr_t khronos_uintptr_t;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;

View File

@ -1,2 +1,2 @@
major=4
minor=0
minor=1