summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-12-17win32: Move dynamic symbol loading to do_dlsym().Eric Anholt1-12/+13
This should help get us better error handling when we accidentally call the wrong loader path.
2013-12-17win32: Start wrapping the 1.0 wgl functions.Eric Anholt1-13/+12
I want to have a chance to intercept wglMakeCurrent for WGL's context-dependent function pointer handling.
2013-12-17win32: Use thread local storage to get us a dispatch table per thread.Eric Anholt3-2/+79
2013-12-17Don't forget to tell our users that the epoxy GL functions are __dllimport.Eric Anholt3-5/+9
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).
2013-12-16Add and clean up some more comments in the python.Eric Anholt1-9/+22
Fixes #8
2013-12-16Update python comments about aliases.Eric Anholt1-4/+2
2013-12-16Add support for lower-priority aliases of functions.Eric Anholt1-0/+16
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.
2013-12-16Fix copyrights on the Makefile.ams.Eric Anholt4-64/+68
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.
2013-12-16Update header comments about how the implementation works.Eric Anholt3-23/+6
2013-12-16Drop the inconsistent use of #pragma once.Eric Anholt3-6/+0
Apparently it's not totally portable, and the #ifdefs work fine (and equivalently to the pragma, on some compilers).
2013-12-16Fix testsuite build on OS X.Eric Anholt2-1/+9
There's no linker flag of this name in the normal clang, presumably beause the linker feature doesn't exist.
2013-12-15Fix printout of missing versions/extensions.Eric Anholt1-1/+1
Not sure how I misplaced the \n in the previous fix.
2013-12-15Fix declaration of glBegin/End_unwrapped.Eric Anholt1-2/+2
On non-win32, it was declaring a new function pointer variable on every #include, and OS X's linker got angry.
2013-12-15Fix loading of extension functions on OS X.Eric Anholt1-0/+2
For a non-GLX application, at least, we need to pull our extensions using dlsym, not glXGetProcAddress(). The symptom was a segfault in glXGetProcAddress().
2013-12-15Use a non-inlined helper for the simple case of a single provider.Eric Anholt1-16/+38
This reduces the built size by another 37k.
2013-12-15Reuse the same string table in one more place.Eric Anholt1-1/+3
Saves another 53k on disk, no relocations.
2013-12-15Use offsets into a string table to reduce the binary size.Eric Anholt1-4/+20
Saves 54k on disk and 3700 relocations.
2013-12-15Move the #defines into the main generated header.Eric Anholt7-17/+1
I initially thought I was going to have two sets of defines you chose from using #include, but that never ended up being necessary.
2013-12-15Abandon ifuncs and go with the traditional global function pointers.Eric Anholt5-62/+69
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.
2013-12-13Fix the behavior of glx_shared_znow if it doesn't die at startup.Eric Anholt2-0/+3
We're sharing the source file with glx_static, but we don't want to SKIP due to not being statically linked.
2013-12-13Add a test showing a way that our ifuncs are broken.Eric Anholt2-0/+8
2013-12-13Relink tests when the library changes.Eric Anholt1-8/+8
For the dynamically-linked tests, it wasn't a big deal because the updated library was always picked up. But for glx_static, we were actually testing stale code.
2013-12-13Add a check that we've made it into the C runtime when doing dlopen().Eric Anholt1-0/+17
This should give us a more informative failure mode than the one mentioned in the README.
2013-12-12Fix infinite loop in extension detection when the needle is a substring.Eric Anholt1-3/+7
We could keep examining the same ptr value over and over.
2013-12-12Fix loading of EGL 1.1+ entrypoints.Eric Anholt1-2/+3
2013-12-12Include epoxy/gl.h instead of epoxy/gl_generated.h from egl_generated.hEric Anholt1-1/+1
This gets us the safety check for including GL/gl.h before epoxy/gl.h
2013-12-12Include epoxy/gl.h from epoxy/glx.h.Eric Anholt1-0/+1
This gives us consistency with GL/glx.h's include of GL/gl.h.
2013-12-12Remove a bad alias of glGetAttachedShaders.Eric Anholt1-1/+0
On OS X, GLhandleARB is void *, which is of different size than GLuint on 64-bit. Because of this, the implementation of glGetAttachedObjectsARB must be different from glGetAttachedShaders, since the pointers/ints are packed the output memory.
2013-12-12Fix most GLhandleARB warnings on OS X with a big comment in our code.Eric Anholt2-2/+25
2013-12-12Use the right library name for GLX on OS X.Eric Anholt1-2/+8
2013-12-11Fix the build of the headerguards test on OS X.Eric Anholt1-0/+5
2013-12-11Fix the path to the GL library on OS X.Eric Anholt1-0/+11
2013-12-11Fix signedness warning on OS X build of the testsuite.Eric Anholt1-1/+1
2013-12-11Disable EGL on OS X.Eric Anholt3-1/+23
It doesn't exist. There's EAGL, but that's not something we're covering.
2013-12-11Use X11_CFLAGS during the build so we find the right xlib headers.Eric Anholt1-1/+5
We don't need x11_libs, because we don't directly call any xlib functions. We're just passing xlib types around.
2013-12-11Add an appropriate error message if libX11 is missing.Eric Anholt1-0/+4
2013-12-11Add build instructions to the readme.Eric Anholt1-0/+28
2013-12-11Update the README for WGL support.Eric Anholt1-1/+1
2013-12-11Link the library with -Bsymbolic.Eric Anholt1-0/+1
We don't want anybody to accidentally override the library's internal usage of epoxy_has_gl_extension() or similar public interfaces.
2013-12-11Use ifuncs on Linux to avoid dispatch table overhead.Eric Anholt2-0/+62
These tell the linker to generate GNU_IFUNC relocs that rewrite the PLT entries in the user's address space to point to our resolved GL function, so there's no extra function pointer. It also, as a bonus, cuts 400k out of the library. This requires a toolchain from 2010 or so. Unfortunately, it's going to take a bit more investigation to find out what specific bits are required. Fixes #4
2013-12-11Fix compiler warning in glx_static.Eric Anholt1-0/+1
2013-12-11Make glx_static report skip if it was built non-static.Eric Anholt1-0/+5
It won't have that symbol, unless it happens to be linked against the full library.
2013-12-11Add a testcase for trying to use libepoxy as a static library.Eric Anholt3-0/+67
Note that it will only actually link statically against epoxy if you've set --enable-static.
2013-12-11Move the unwrapped logic to function setup.Eric Anholt1-18/+17
I'm going to want the same stuff for ifuncs.
2013-12-11Make func.alias_name always have the name of our alias.Eric Anholt1-13/+6
The "None" for "we're not an alias of anything else" wasn't actually simplifying things.
2013-12-10Reduce the overhead of the dispatch table usage.Eric Anholt1-8/+54
We now initialize our dispatch table with function pointers that go and do the rewrite, then we never have to check for a NULL table entry again. On my 64-bit build, epoxy_glClear() drops from 83 bytes to 14, while the total library size only goes up by 5%. This also paves the way for fixing our dispatch table management using TLS on windows.
2013-12-10Add a test for basic functionality on win32.Eric Anholt5-0/+256
2013-12-10Add dispatch generation for wgl.Eric Anholt8-1/+212
This is very poorly tested at this point, but survives a simple testcase.
2013-12-10Use get_core_proc_address() on win32.Eric Anholt1-2/+2
This is needed for glGetString() lookup to work, since wglGetProcAddress() returns NULL for core procs.
2013-12-10Fill in the begin/end counting on win32.Eric Anholt1-3/+3