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.
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.
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.
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.
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
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
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).
If you happened to do both GLES2 and GLES1 in a process, it meant that
you'd try to look up v1 procs in the v2 API, and lose. Caught by
piglit oes_fixed_point-attribute-arrays.
For performance, I want to be able to make single-context (well,
single-pixel-format-and-device) apps be able to directly call GL
functions through function pointers. Bake that into the ABI now so I
can get a release out the door and fix this up later.
This also fixes the lack of __stdcall annotation on the
PFNWHATEVERPROC typedefs.
This lets the compiler generate faster function calls (call through
function pointer, instead of call into a linker-generated stub func
containing jump to function pointer).
For example, on desktop 2.1 GL on Apple, there's no glBindVertexArray,
but there is glBindVertexArrayAPPLE, and as far as a caller is
concerned, the APPLE variant should be able to stand in for the
core/ARB version. Similarly for trying to do FBOs on an old Mesa
implementation that didn't have ARB_fbo yet, but did have EXT_fbo.
When initially writing the Makefiles, I started from a Makefile.am
that had ajax's copyright instead of an Intel one. The only line I
can see that's left from the original Makefile.am is "pkgconfigdir" in
the root Makefile.am.