Commit Graph
519 Commits
Author SHA1 Message Date
Eric Anholt e94a0816d7 test: Add unit tests for epoxy_gl_version() and epoxy_glsl_version().
Based on a bug report I got on IRC.

v2: Drop glx includes, add to automake.
2018-11-01 13:26:32 -07:00
Emmanuele Bassi a7439f9732 ci: Update the Meson version for AppVeyor 2018-10-05 00:53:21 +01:00
Emmanuele Bassi 545b911d01 Post-release version bump to 1.5.4 2018-10-05 00:46:33 +01:00
Emmanuele Bassi 16b1481e00 Merge pull request #193 from anholt/issue-188
Ensure Autotools enables EGL-X11 support
1.5.3
2018-10-05 00:12:11 +01:00
Emmanuele Bassi a5c019ee1b Ensure Autotools enables EGL-X11 support
The X11 support in the Autotools build is missing the definition of the
ENABLE_X11 pre-processor symbol. Without it, we're missing the X11
platform definitions for EGL.

Fixes #188
2018-10-04 21:59:34 +01:00
Emmanuele Bassi 439e8b7867 Merge pull request #192 from anholt/meson-bump
Require a newer version of Meson
2018-10-04 22:54:36 +02:00
Emmanuele Bassi f69fa3a3d4 Merge pull request #189 from jbicha/gitignore-patch
gitignore: Don't ignore .patch files
2018-10-04 19:25:57 +02:00
Emmanuele Bassi bf531d1042 build: Drop conditional use of get_supported_link_arguments()
Meson complains even in the face of a version check.
2018-10-04 18:07:34 +02:00
Emmanuele Bassi 7a88ef5741 Update minimum Meson version
We're using functionality introduced after 0.44, so we might as well
update to a more recent version of Meson.
2018-10-04 18:05:58 +02:00
Jeremy Bicha 9304c4a9c1 gitignore: Don't ignore .patch files
This makes things a bit awkward for distros that
keep their packaging in git and use patch files
2018-09-18 14:30:18 -04:00
Emmanuele Bassi e97162bad5 Merge pull request #184 from quink-black/dev
dispatch_common: fix conditional compilation

Symbols are always defined, but they are set to 0 or 1; this means we can't use `ifdef`.
2018-07-25 13:33:32 +01:00
Zhao Zhili 119f06f823 dispatch_common: fix conditional compilation 2018-07-16 12:51:48 +08:00
Adam Jackson 2edc497374 dispatch: Fix GLES3 symbol lookup
Looking for a symbol named "libGLESv2.so.2" is probably not going to
work very well.
2018-07-06 13:36:29 -04:00
Emmanuele Bassi 49bec45b28 Merge pull request #182 from anholt/issue-181
Define _GNU_SOURCE for strdup()
2018-06-18 09:57:21 +01:00
Emmanuele Bassi 7f38b12881 Define _GNU_SOURCE for strdup()
The strdup() function is available on uClibc if _XOPEN_SOURCE_EXTENDED
is defined; since we're using _GNU_SOURCE elsewhere to enable extended
libc features, and uClibc will set _XOPEN_SOURCE_EXTENDED if _GNU_SOURCE
is set, let's use that.

Closes #181
2018-06-18 09:15:03 +01:00
Emmanuele Bassi b3f67d47bd Add a CGL test for the Epoxy API
Just like the one we use for EGL.
2018-06-04 12:31:13 +01:00
Emmanuele Bassi 7e4b490ce7 Add a CoreGraphics OpenGL test for macOS
A basic test, to check that we're actually capable of working on macOS
without GLX enabled.
2018-06-04 12:30:11 +01:00
Emmanuele Bassi dadf83df00 ci: Dump the test log on failure
We need to see what failed, as Meson's test harness will just show the
result.
2018-06-04 12:30:11 +01:00
Emmanuele Bassi 3824efc25c Merge pull request #178 from ebassi/osx-ci
Fix build of Epoxy on macOS
2018-05-30 16:15:56 +01:00
Emmanuele Bassi 02a5e55f21 ci: Enable builds on macOS
Use Travis's macOS builder to check if Epoxy is building on that
platform.
2018-05-29 23:09:39 +01:00
Emmanuele Bassi 8c3d371187 Use the appropriate symbols on __APPLE__
When building on macOS we don't have access to EGL, and GLX support is
conditional.

We should ensure we're using the appropriate paths depending on the
platform, and protect our use of macros to avoid undefined symbols.

Closes: #176
2018-05-29 22:58:41 +01:00
Emmanuele Bassi 350a98a308 Disable EGL on macOS
EGL is not available on macOS, except through Objective C.
2018-05-29 22:47:40 +01:00
Emmanuele Bassi 7b8a540dce Post-release version bump to 1.5.3 2018-05-19 12:12:27 +01:00
Adam Jackson 707f50e680 dispatch: Try harder to avoid calling the resolver
Our caller may load (eg) epoxy_glAlphaFunc, which is a function pointer,
and then call through that value multiple times. Until the caller
re-examines the value of that function pointer, which is a copy
relocation in the executable, repeated calls mean repeated work
resolving the GL function.

We can't make the caller reinspect the variable, but the resolver
function can avoid doing redundant work.

Fixes: anholt/libepoxy#171
Signed-off-by: Adam Jackson <[email protected]>
1.5.2
2018-05-17 12:03:33 -04:00
Emmanuele Bassi c00c889e62 Use -Bsymbolic-functions instead of -Bsymbolic
Epoxy updates the function pointers in order to avoid calling the
resolver multiple times, but with -Bsymbolic we're going to update the
copy inside libepoxy, instead of the relocated copy in the code using
libepoxy. This leads to libepoxy constantly querying the function
resolver code instead of just once.

We still want to avoid intra-library relocations for our functions,
but we need to live with them for our global function pointers.

See issue #171
2018-05-17 12:02:42 -04:00
Emmanuele Bassi 791b28c186 Use abort() instead of exit(1)
We want to consistently handle exceptions for the internal state checks;
calling `exit()` does not allow us to attach a debugger and get a proper
trace.
2018-05-17 12:02:42 -04:00
Emmanuele Bassi 737b691870 Merge pull request #172 from lantw44/master
Fix dlwrap for FreeBSD
2018-05-05 13:31:43 +01:00
Emmanuele Bassi ff709d3d65 Merge pull request #170 from nwnk/epoxy-load-foo
Make epoxy_load_{egl,glx} load libraries if they exist
2018-05-05 13:29:26 +01:00
Ting-Wei Lan 27b0746940 dlwrap: Add FBSD_1.0 version for FreeBSD
This fixes dlwrap_real_dlsym on FreeBSD, but tests still fail because we
currently don't have libglvnd.
2018-05-05 00:00:55 +08:00
Ting-Wei Lan 5dc0c147e9 meson: Don't define _POSIX_C_SOURCE when dlvsym is found
FreeBSD hides declarations of non-POSIX functions when POSIX macros,
such as _POSIX_C_SOURCE or _XOPEN_SOURCE, is defined. This causes
test/dlwrap.c to fail to compile because it uses dlvsym and asprintf.

Fixes: #169
2018-05-04 23:50:36 +08:00
Adam Jackson 90db0069b4 dispatch: Load EGL/GLX provider lib from epoxy_has_{egl,glx}()
Now that we're being conservative about probing libraries, these
entrypoints would not succeed unless the caller had already dlopened
stuff themselves, or had explicitly linked against the provider library.
Both of those are exactly not what we want.

Signed-off-by: Adam Jackson <[email protected]>
2018-05-01 11:50:30 -04:00
Adam Jackson 53ae0bbffe dispatch: Stop implicitly loading libraries from do_dlsym
Mostly this is to get all the calls to get_dlopen_handle nicely isolated
so they're easier to reason about.

Signed-off-by: Adam Jackson <[email protected]>
2018-05-01 11:20:30 -04:00
Emmanuele Bassi b80ea6a36a Merge pull request #168 from nwnk/even-more-gentle-glx-detection
Even more gentle glx detection
2018-04-30 23:39:22 +01:00
Adam Jackson a33623dca7 dispatch: Be even gentler about probing for GLX
dlsym(NULL) can only see (symbols in) libraries that are loaded
RTLD_GLOBAL, but our dlopen()s are RTLD_LOCAL and probably so was the
one the app did if it did one. So use RTLD_NOLOAD to probe for the
library even if it's LOCAL, iff the lookup is non-fatal.

Having done that, don't ever load any libraries on this path. We only
perform this check while resolving rendering API functions, and the
window system resolution paths already load the appropriate library if
they need to. Since you have to have gone through a winsys to get a
context, and our resolvers only run when a function is _called_, this
would only introduce a failure mode if you tried to call a function
without a context bound.

Signed-off-by: Adam Jackson <[email protected]>
2018-04-30 15:38:01 -04:00
Adam Jackson b5a4b16799 dispatch: Query the EGL context version when bootstrapping on GLES
We're about to change our dlopen paths to do RTLD_NOLOAD more
aggressively. The issue then is we can create an EGL GLES context
without libGLES* ever being loaded. test/egl_gles2_without_glx will fail
in such a world: the first gentle probe for libGLESv2 will fail, then
the less-gentle probe for libGLESv1_CM will be shot down by the test,
and we exit.

Fortunately by the time we've gotten to this point the context exists,
so we can query its version via EGL instead.

Signed-off-by: Adam Jackson <[email protected]>
2018-04-30 15:33:42 -04:00
Adam Jackson 43ac91170d test/glx_public_api_core: Fail softer if core contexts aren't available
If you've built Mesa with --disable-texture-float, and try to run the
tests against Xvfb, glx_public_api_core will fail: creating a direct
context with llvmpipe will fail because you don't have
ARB_texture_float, and the internal fallback to an indirect context will
fail because indirect only supports through 1.4. So the server will
throw GLXBadFBConfig at you to say "I don't support core contexts",
which we should interpret as a skip not a failure.

Signed-off-by: Adam Jackson <[email protected]>
2018-04-30 14:12:43 -04:00
Emmanuele Bassi 610203a1a4 meson: Fix the -z,relro flag
We're missing a dash.
2018-04-25 18:50:28 +01:00
Emmanuele Bassi 45f3e8c286 Post-release version bump to 1.5.2 2018-04-25 12:11:10 +01:00
Emmanuele Bassi 897e519474 ci: Use envvars to control the build options
Instead of calling docker multiple times ourselves, use the `env` stanza
to control the build options.
1.5.1
2018-04-25 11:51:55 +01:00
Emmanuele Bassi c8613a2984 meson: Remove unsupported keyword
The has_header() function does not have a `required` argument.
2018-04-25 11:43:12 +01:00
Emmanuele Bassi af76cd235d meson: Conditionally test for linker flags
Meson 0.46 introduced a function to check for linker flags passed to the
compiler; since the version is really brand new, I don't want to bump
the dependency on Meson just yet, so we're going to conditionally use
get_supported_link_arguments() only if we're building with Meson 0.46 or
later.
2018-04-25 11:37:44 +01:00
Emmanuele Bassi 5fa7bf6e27 Remove the "EGL/GLX have different pointers" tests
The correct answer for systems with different EGL and GLX driver
implementations is to use GLVND.`

Closes #165
2018-04-12 16:42:06 +01:00
Emmanuele Bassi fc5750ca01 Merge pull request #166 from nwnk/assert
dispatch: assert, not errx, when we have no context
2018-04-12 16:37:19 +01:00
Adam Jackson f7486f7753 dispatch: assert, not errx, when we have no context
errx() calls exit(), you'd rather get a backtrace.

Signed-off-by: Adam Jackson <[email protected]>
2018-04-12 11:04:10 -04:00
Emmanuele Bassi 74dbb7bac9 Merge pull request #162 from 1ace/meson-simplify
meson: simplify build_{glx,egl} logic
2018-03-13 17:50:17 +00:00
Eric Engestrom 5f151684da meson: simplify build_{glx,egl} logic
Signed-off-by: Eric Engestrom <[email protected]>
2018-03-13 17:16:31 +00:00
Emmanuele Bassi 500f522d47 Merge pull request #156 from tschoonj/fix-gl-pkgconfig-macos
meson: do not add gl to pkg-config file on macOS
2018-03-12 12:18:54 +00:00
Emmanuele Bassi 2189bc0d9b Merge pull request #159 from luzpaz/misc-typos
Trival misc. typo fixes
2018-03-12 12:18:25 +00:00
Emmanuele Bassi 6769ba25bc Merge pull request #158 from rossburton/master
Improvements to the test suite
2018-03-12 12:17:47 +00:00
Ross Burton f9098b0c18 autotools: check for dlvsym
As per the previous commit, instead of assuming that Apple doesn't have dlvsym
but everywhere else does, actually check for dlvsym() existing as that function
is glibc-specific.
2018-03-12 12:02:08 +00:00