134 Commits
Author SHA1 Message Date
Eric Anholt b06552c4dc Imported Upstream version 1.3.1 2015-07-15 16:52:35 -07:00
Eric Anholt 35016b7589 Also drop the publishing of epoxy_conservative_egl_version()
Like epoxy_conservative_gl_version(), it's internal only (and didn't
have a published prototype in the headers).
2015-07-15 16:44:44 -07:00
Eric Anholt b73be3c588 Imported Upstream version 1.3 2015-07-15 16:16:10 -07:00
Eric Anholt 585c703699 Add some missing spacing in generated code. 2015-07-15 16:09:06 -07:00
Eric Anholt b2c00a18af Use a concatenated string for enum descriptions.
Saves another 15kb of compiled code.
2015-07-15 16:09:06 -07:00
Eric Anholt d4620b7dd3 Use __attribute__((packed)) to reduce our data size.
Since our provider enums are small, we can store them as bytes or
shorts if we just let the compiler know that it's OK.  Saves 20kb in
the compiled library.
2015-07-15 14:47:39 -07:00
Eric Anholt 62861d12f9 Emit APIENTRY for typedefs that use it.
The XML uses a node for where the string should be.  This should fix
segfaults using GL_ARB_debug_output on windows.

Fixes #46.
2015-07-15 14:27:48 -07:00
Yaron Cohen-Tal a7c270f8e2 Fix epoxy_egl_get_current_gl_context_api() on non-conformant ES.
According to the OpenGL ES standard, "glGetString(GL_VERSION)" should
return a string starting with "OpenGL ES".  However, PowerVR's OpenGL
ES implementation (and perhaps others) don't comply with the standard
here.  If our context happend to be bound using EGL, then we can just
ask EGL what kind of context it was, avoiding the glGetString() check.
2015-07-15 14:07:06 -07:00
Eric Anholt 227d1312e6 Look for GL 1.1 functions in win32's OpenGL32.dll.
The windows ABI is GL 1.1, not 1.0.  You get NULL pointers for 1.1
functions when calling wglGetProcAddress().  Fixes #47.
2015-07-15 13:52:56 -07:00
Chun-wei Fan d9df59df71 src/dispatch_common.c: Remove Unneeded PUBLIC Annotation
Don't mark epoxy_conservative_gl_version() for export, as it is meant
to be a private API to be used within libepoxy only.

Reviewed-by: Eric Anholt <[email protected]>
2015-06-17 22:38:50 -07:00
Chun-wei Fan e9f68fe3a3 Fix generated code for building on MSVC 2013
This updates the script to generate code that is buildable by Visual Studio
2013 by:

-Using a macro to define the compiler-specific way to do noinline for a
 function, and use it when needed.

-Avoid using empty arrays and structs as that is a C99 feature that will
 likely be never support on Visual Studio as it is now an optional feature
 of C11.
2015-06-05 17:51:08 -07:00
Chun-wei Fan 7d5e8e9d56 Put the callspec after the return type for MSVC.
Visual Studio does not like __stdcall before the return type, which is
what GLAPIENTRY and EPOXY_CALLSPEC expands to on Windows.
2015-06-05 17:51:08 -07:00
Chun-wei Fan e242497728 Avoid empty struct intializer on MSVC.
It is a C99 feature that is not supported (nor will it probably be at
any point) on Visual Studio.
2015-06-05 17:51:08 -07:00
Chun-wei Fan 95ecc2d1a1 Port the library_init() constructor to MSVC. 2015-06-05 17:51:07 -07:00
Eric Anholt 136cf85424 Use the provider enum to tie-break sorting by function provider name.
Without this, we got code generation that was dependent on the
original ordering in the hash table, and thus non-reproducible builds.

Based on a commit by Stephan Kulow, but retaining the sorting by
function name first (that way all providers with the same name appear
next to each other like before, and also happens to ensure that core
names tend to appear before non-core names)
2015-06-05 17:22:58 -07:00
Eric Anholt 135f7bf104 wgl: Fix an extra break statement.
This would have leaked our TLS indices on process exit.

Fixes #32
2015-01-10 11:18:50 +13:00
Eric Anholt 363d57a9de Merge remote-tracking branch 'sonicadvance/OSX-NoX11Support'
I've come around to the various contributors' positions: X11 on OSX is
basically dead, and we're not serving our users by trying to support
it.
2015-01-10 10:30:16 +13:00
Eric Anholt 0096b79923 Fix context type detection if we find eglGetCurrentContext().
Fixes #29.
2014-06-13 15:00:31 -07:00
Eric Anholt d56f21c494 Use the EGL pkgconfig for finding eglplatform.h.
We don't ever explicity link against libEGL, so no need to make use of
EGL_LIBS.

Fixes #30.
2014-06-13 14:59:37 -07:00
Eric Anholt 28c9c471b2 Remove a C99ism from dispatch.
I've decided it's time to accept that building with MSVC 2010 is a way
that people want to use this software.
2014-06-13 13:55:42 -07:00
Ryan Houdek e3051481cc Adds support for OS X without X11.
OS X support shouldn't depend on X11 being installed on the host.
Removes the X11 dependency.
2014-05-28 22:20:39 -05:00
Ryan Houdek c791612b0a Adds support for Android.
This has been tested with both OpenGL and OpenGL ES on Android.
We can't use dlsym on Android to get all the function pointers since Android's libGLES* libraries are just shim libraries that pass everything through
to the real vendor specific libraries.

Due to this we must grab function pointers entirely through eglGetProcAddress instead of dlsym.
2014-05-28 22:18:56 -05:00
Eric Anholt c7a91844de Don't forget to install the wgl headers.
Fixes #26
2014-05-13 12:36:43 -07:00
Eric Anholt 568533441f Move __stdcall into the parens for function pointer definitions.
MSVC 2010 appears to require that it be located there.
2014-04-10 13:37:47 -07:00
Eric Anholt 6eb075c70e Fix EGL context detection for non-GLES2-core functions.
Fixes failure of the X Server with glamor using desktop GL on EGL, and
the associated testcase in the tree.  This was clearly just
copy-and-paste failure on my part in
b251e3ae33.
2014-04-08 23:54:26 -07:00
Eric Anholt 3e09de7550 win32: Delay using dispatch tables until the second MakeCurrent.
Fixes #11.
2014-03-28 16:45:26 -07:00
Eric Anholt 370c49d5cd Use #defines to shrink the size of gl_generated_dispatch.c
I was running into file size limits with win32 debug symbols.
2014-03-28 16:33:53 -07:00
Eric Anholt 11a946cbf5 Prefer non-aliased functions when resolving.
This increases the size of the library, but avoids some of the
concerns that have been brought up with the library silently switching
you from glWhateverEXT() to glWhatever() if there might be slight
behavior differences between the two that hadn't been identified.  The
downside is that it means we can't share the resolver functions among aliases.
2014-03-28 16:33:53 -07:00
Eric Anholt b1d875ef0b Clean up epoxy_current_context_is_glx().
Now that it's split out from epoxy_get_core_proc_address(),
the particular symbols we were testing for before calling
GetCurrentContext() didn't make much sense, plus we were leaking
dlerror()s still.
2014-03-27 23:17:02 -07:00
Eric Anholt db5b939f98 Ask glXGetProcAddress for ES symbols when we're on a GLX context.
Fixes #24
2014-03-27 23:17:02 -07:00
Eric Anholt b251e3ae33 Factor out the GLX versus EGL current context detection code.
It turns out I need to reuse this for GLES symbols when using
GLX_EXT_create_context_es2_profile.
2014-03-27 23:17:02 -07:00
Eric Anholt d48978c084 Don't leak dlerror()s while we're trying to probe libraries.
Again, no known bugs, but it seems like a bad idea.
2014-03-27 23:17:02 -07:00
Eric Anholt 72187a29c2 Don't dlsym() if we failed to dlopen().
No reported bugs I'm fixing here, just cleanup.
2014-03-27 23:17:02 -07:00
Eric Anholt e7d3088d71 win32: Add support for wglUseFontBitmaps().
Fixes #10.
2014-03-27 15:33:21 -07:00
Eric Anholt 5dcdfe9d79 Remove a debug printf that slipped in. 2014-03-27 08:43:31 -07:00
Eric Anholt 847a6d50db Avoid using eglGPA() for core funcs when the current context is GLX.
If you already had GLX loaded by epoxy, this wouldn't happen, but on
the first call, fallback cases might have taken the EGL path if EGL
was loaded.
2014-03-19 18:43:21 -07:00
Eric Anholt b670c84039 Refactor dispatch_common's EGL context detection code.
I want to reuse this from get_core_proc_address().
2014-03-19 18:43:19 -07:00
Eric Anholt e6d9bb971b Try to use glXGPA() for core funcs if the current context is GLX.
Fixes the GLX-only subtest of egl_and_glx_different_pointers.  Now
what remains is dispatch tables for when you're actively using both.

Fixes #23
2014-03-19 18:34:30 -07:00
Eric Anholt 698185e24a Try to avoid looking up bootstrap functions in the wrong library.
Fixes the EGL-only subtest of egl_and_glx_different_pointers.
2014-03-19 18:34:30 -07:00
Eric Anholt 037ac7f566 Add a test for EGL and GLX returning different function pointers.
This is the case on the nvidia binary driver's GL, or when you've got
a system mixing nvidia binary GL and Mesa EGL.
2014-03-19 17:39:52 -07:00
Eric Anholt 9efad17eb4 Actually fix #21 (hopefully). 2014-03-17 11:21:11 -07:00
Eric Anholt 14f24485e3 Add support for looking up GLES3 functions using dlsym().
ARM and Mesa disagreed on how to look up the functions, so support
both ways.

Fixes #21
2014-03-17 11:20:10 -07:00
Eric Anholt 53b87c33e4 Catch eglBindAPI() failures in looking up bootstrap functions.
This fixes crashes on ARM's Mali drivers, where desktop GL isn't
supported, and epoxy didn't notice the error and tried to dlsym() on
libGL.so.1.

An alternative would have been to look at the response from
eglQueryAPI() first, but that would have meant that we still need to
BindAPI in the case that eglQueryAPI returns something like VG or CL,
and so we needed to handle these errors regardless.

Fixes #22
2014-03-17 11:02:41 -07:00
Fredrik Höglund e20b3ce6c7 Fix EGLDisplay parameters in epoxy functions
EGLDisplay is typedefed as a pointer.
2014-02-12 00:56:57 +01:00
Eric Anholt 81ccc70837 Fix some silly line-wrapping in a printf. 2014-02-06 13:17:23 -08:00
Eric Anholt c4d19366cc Add a missing \n on an error message. 2014-02-06 11:29:36 -08:00
Eric Anholt 766422a82c Use the same typedefs as upstream khrplatform.h in a couple cases.
This should avoid any differences we might end up with compared to
system khrplatform.h.
2014-02-06 11:23:43 -08:00
Eric Anholt c996534080 Define the rest of the khrplatform.h types, and prevent its inclusion.
One of the problems with krhplatform.h (besides it being a terrible
idea in the first place) is that it's not present on many systems at
all, including apple, win32, and linux before late 2009.

So, unless we introduce the first ./configure dependency to the core
library build, we really do need to define these standard types to
their standard values.  But if we allow khrplatform.h inclusion as
well, we'll get long-vs-int redefinition warnings on 32-bit.  So, we
have to completely replicate the header, which is a thing we've done
for everything else except for eglplatform.h.

A testcase will be used to make sure that our types don't drift from
the system khrplatform.h types, if it even exists.

Fixes #17
2014-02-06 11:16:11 -08:00
Eric Anholt 17e5c307f5 Add missing dependency on libdl.
Everything I'd linked against the library so far already had a libdl
dependency (through libX11, for example), so I hadn't noticed.
2014-02-01 12:32:42 -08:00
Matt Turner 309f2d2020 Use LDADD instead of LDFLAGS/DEPENDENCIES.
This is a lot shorter to type, and still gets the dependencies to work
(tested with touch src/dispatch_common.c; make check, and touch
src/egl_common.c; make check).
2014-02-01 12:32:09 -08:00