Eric Anholt
db5b939f98
Ask glXGetProcAddress for ES symbols when we're on a GLX context.
...
Fixes #24
11 years ago
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.
11 years ago
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.
11 years ago
Eric Anholt
72187a29c2
Don't dlsym() if we failed to dlopen().
...
No reported bugs I'm fixing here, just cleanup.
11 years ago
Eric Anholt
5dcdfe9d79
Remove a debug printf that slipped in.
11 years ago
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.
11 years ago
Eric Anholt
b670c84039
Refactor dispatch_common's EGL context detection code.
...
I want to reuse this from get_core_proc_address().
11 years ago
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
11 years ago
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.
11 years ago
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.
11 years ago
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
11 years ago
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
11 years ago
Eric Anholt
81ccc70837
Fix some silly line-wrapping in a printf.
11 years ago
Eric Anholt
c4d19366cc
Add a missing \n on an error message.
11 years ago
Eric Anholt
a55d28ee1b
Fix a missing \n on printing out failure to dlsym().
11 years ago
Eric Anholt
1064406814
Fix using epoxy on systems with only EGL and GLES1 or GLES2.
...
Fixes #19
11 years ago
Eric Anholt
72e57908c6
Fix typo in gles2 dlsym setup
...
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.
11 years ago
Eric Anholt
aa778ef39d
Add support for Mesa's GLES1 implementation.
...
Mesa reports "OpenGL ES-CM 1.1", so we need to not look for a space
after "ES", and 1.1 is still a 1.0-compatible implementation.
11 years ago
Eric Anholt
9bc909f5a7
win32: Convert the API to being based on function pointers, like Linux.
...
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.
11 years ago
Eric Anholt
c4214a39f4
win32: Reset all dispatch tables to re-resolve on any wglMakeCurrent.
11 years ago
Eric Anholt
8dcd1512db
Drop the PLATFORM_HAS_EGL check in epoxy_egl_dlsym().
...
If you accidentally call it on a non-egl platform, better to get an
informative error message.
11 years ago
Eric Anholt
5112b477c2
win32: Move dynamic symbol loading to do_dlsym().
...
This should help get us better error handling when we accidentally
call the wrong loader path.
11 years ago
Eric Anholt
c24afd8a9e
Fix printout of missing versions/extensions.
...
Not sure how I misplaced the \n in the previous fix.
11 years ago
Eric Anholt
26880549bc
Fix loading of extension functions on OS X.
...
For a non-GLX application, at least, we need to pull our extensions
using dlsym, not glXGetProcAddress(). The symptom was a segfault in
glXGetProcAddress().
11 years ago
Eric Anholt
3d2a2b3c80
Abandon ifuncs and go with the traditional global function pointers.
...
In addition to the failing testcase, there were a couple of
regressions in piglit's attribs test: one from glBegin_unwrapped vs
glBegin confusion in the __asm__ directives we were generating, and
one where the function pointers apparently were just getting mixed up
at application runtime.
11 years ago
Eric Anholt
10c611a3f1
Add a check that we've made it into the C runtime when doing dlopen().
...
This should give us a more informative failure mode than the one
mentioned in the README.
11 years ago
Eric Anholt
03e9537331
Fix infinite loop in extension detection when the needle is a substring.
...
We could keep examining the same ptr value over and over.
11 years ago
Eric Anholt
8d8334c350
Use the right library name for GLX on OS X.
11 years ago
Eric Anholt
d82c5c33a6
Fix the path to the GL library on OS X.
11 years ago
Eric Anholt
708c31a406
Disable EGL on OS X.
...
It doesn't exist. There's EAGL, but that's not something we're
covering.
11 years ago
Eric Anholt
1d746bfeb2
Add dispatch generation for wgl.
...
This is very poorly tested at this point, but survives a simple testcase.
11 years ago
Eric Anholt
4eaf4bfe21
Fill in the begin/end counting on win32.
11 years ago
Eric Anholt
b128dd9b25
Move the check for whether to dlsym or GPA on linux to the common C code.
...
This is going to change for macos and win32, and this will be easier
than trying to spread that logic through the python code and into the
generated code.
11 years ago
Eric Anholt
259136845d
Start porting the GL dispatch code to win32.
...
It now builds successfully builds a .dll file. Not that it's usable
or anything yet.
11 years ago
Eric Anholt
60ea7c38a2
Move GLX/EGL dispatch code using those API types to separate files.
...
The dlopen bits are left in place, but the functions required the
types, and in the case of EGL, the types require that the platform
header actually exists.
11 years ago
Eric Anholt
906d5b6e3a
Conditionalize building the EGL and GLX dispatch code.
11 years ago
Eric Anholt
9b8ac73231
Improve the quality of the missing providers output.
...
In particular, note when it's probably our bug, not the app's bug.
11 years ago
Eric Anholt
8d208fff51
Print the missing provider information to stderr.
11 years ago
Eric Anholt
0983996e49
Fix calling new entrypoints from within glBegin()/glEnd().
11 years ago
Eric Anholt
1cb041fbaa
Fix a compiler warning in the previous commit.
11 years ago
Eric Anholt
8bb5a2545e
Fix extension detection on core GL contexts.
...
The nasty old strings were deprecated.
11 years ago
Eric Anholt
0270c80008
Add support for EGL.
...
This totally replaces the getprocaddress and dlsym code, which was
basically just stubs up until now. The is_glx/is_egl() is also
dropped -- they weren't doing anything, and the only false answer they
could give is if the dlopen were to fail.
11 years ago
Eric Anholt
de70a2a0ab
Fix a similar bug to HEAD~2, this time in epoxy_has_glx_extension().
11 years ago
Eric Anholt
0f67bf3f11
Fix bug in public entrypoint for epoxy_glx_version()
...
Unfortunately, for GLX 1.4+ entrypoints (just glxGetProcAddress
currently) or extensions, if there isn't a context bound then we don't
have a dpy and screen available to provide useful debug messages. Oh
well.
11 years ago
Eric Anholt
5f60534bac
Fix up an unfinished comment
11 years ago
Eric Anholt
a82e54aafa
Make a table full of strings describing our providers.
...
By having shared code to print the names and a shared table of what
the names are, this reduces the built stripped size of the library by
80k.
11 years ago
Eric Anholt
8139c7c489
Actually implement GLX version detection.
11 years ago
Eric Anholt
ed938dc4c5
Make a few more public functions actually public.
11 years ago
Eric Anholt
66d7b9fb02
Fix the version detection for GL < 3.
...
Those nice enums came late in the GL spec. This code is copied from
piglit, by Matt Turner in 2012.
11 years ago
Eric Anholt
a1d555e446
Fix a copy-and-paste mistake in getting GL version
11 years ago