1. 31 May, 2016 1 commit
    • Kyle Brenneman's avatar
      GLdispatch: Don't unpatch entrypoints in __glDispatchLoseCurrent. · 1b30d153
      Kyle Brenneman authored
      In __glDispatchLoseCurrent, don't try to restore the default entrypoints.
      Instead, __glDispatchMakeCurrent will check if it's using a different vendor
      library, and if so, it will unpatch and repatch the entrypoints then. If it's
      using the same vendor library (which will usually be the case), then it can
      leave them patched and skip the patch overhead.
      Some applications will call glXMakeCurrent to release and bind the same context
      every frame, sometimes multiples times. Each patch and unpatch sequnce can chew
      up 1-2 milliseconds. That's enough to significantly reduce the framerate of
      some applications.
      Reviewed-by: James Jones's avatarJames Jones <jajones@nvidia.com>
  2. 27 May, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Fix a couple of errors. · d0ced9a2
      Kyle Brenneman authored
      Moved the unlock in __glXLookupVendorByName to after the calls to update the
      GLX entrypoints.
      Fixed a typo in GLXEntrypointUpdateCallback.
  3. 20 May, 2016 7 commits
  4. 18 May, 2016 1 commit
    • Kyle Brenneman's avatar
      Merge branch 'libglx-glXGetProcAddress-fixes' · a82982d9
      Kyle Brenneman authored
      Various cleanup and fixes for glXGetProcAddress and the GLX dispatch tables.
      Simplified the code paths behind glXGetProcAddress.
      Moved the GLX dispatch table handling to a new file under src/util, so that it
      will be usable for EGL.
      libGLX will now provide a dispatch index for every GLX function (including core
      functions) to every vendor library. This is useful for functions like
      glXCreateContextAttribsARB, where it allows the GLX dispatch stub to destroy
      the context if the call to addVendorContextMapping fails.
      Reviewed-by: default avatarAndy Ritger <aritger@nvidia.com>
  5. 17 May, 2016 8 commits
    • Kyle Brenneman's avatar
      GLX: Some additional cleanup for the GLX dispatch table. · 17f55660
      Kyle Brenneman authored
      Added a license+copyright comment to winsys_dispatch.[ch].
      Renamed __GLVNDwinsysDispatchIndexHash to __GLVNDwinsysDispatchIndexEntry,
      since it's not a hashtable anymore.
      In __glXLookupVendorByName, only call __glvndWinsysDispatchGetCount once
      instead of on every loop iteration.
      Removed the locks for the GLX dispatch index list and the generated GLX
      dispatch stubs. Instead, the vendor hashtable's lock is used for all three.
      There's enough overlap between when the three locks are taken that using
      separte locks has very little benefit and increases the risk of deadlocks.
    • Kyle Brenneman's avatar
      GLX: Move the vendor GLX dispatch table to winsys_dispatch.c. · 968349de
      Kyle Brenneman authored
      Remove the __GLXvendorInfo::dynDispatchHash hashtable, and replace it with a
      dispatch table from winsys_dispatch.
    • Kyle Brenneman's avatar
      Add functions to keep track of a vendor library's GLX functions. · edd36498
      Kyle Brenneman authored
      Added functions to create and manage a per-vendor dispatch table for
      window-system functions.
      These will replace the __GLXdispatchFuncHash hashtable in GLX.
    • Kyle Brenneman's avatar
      GLX: Clean up __glXFetchDispatchEntry. · 39070d4e
      Kyle Brenneman authored
      Some minor cleanup of __glXFetchDispatchEntry.
      Handle the various failure cases more directly: If we can't find a name, or if
      the vendor library doesn't support a function, then return early.
      If we can't allocate a cache entry for the function, then return the dispatch
      stub anyway. It can try to store the stub again next time.
    • Kyle Brenneman's avatar
      GLX: Fix a race condition in the glXGetProcAddress cache. · b6a1d5a5
      Kyle Brenneman authored
      In cacheProcAddress, check if the function is already in the hashtable before
      trying to add it. It's possible that another thread might have already called
      glXGetProcAddress for the same function.
      In addition, allocate each cache entry with a single malloc instead of a malloc
      and a strdup.
    • Kyle Brenneman's avatar
      GLX: Assign indices to the GLX dispatch functions defined in libGLX. · 774c9b25
      Kyle Brenneman authored
      The dispatch functions in libGLX are now added to the GLX dispatch list just
      like vendor-provided dispatch functions would be.
      The function name cache in glXGetProcAddress is no longer required for
      correctness, because it can look up a locally-defined dispatch stub in the same
      list as the vendor-provided stubs.
      In addition to simplifying glXGetProcAddress, this allows vendor libraries to
      look up all GLX functions by index. In particular, this would allow a vendor
      to look up glXDestroyContext, which would let it recover properly if it fails
      to add a new context to the context-to-vendor mapping.
    • Kyle Brenneman's avatar
      GLX: Use winsys_dispatch to keep track of GLX dispatch stubs. · 8167e35e
      Kyle Brenneman authored
      Remove the __GLXdispatchIndexHash table, and use the list in winsys_dispatch.c
      to keep track of the function indices, names, and dispatch stubs.
      If libGLX generates a GLX dispatch stub, then it will now assign an index to it
      when it generates the stub, not when it fills in the stub. That lets it treat
      generated stubs the same way regardless of whether they've been filled in or
      When assigning an index, it will now call the setDispatchIndex callback for
      every vendor library, not just the vendor that provided the dispatch stub.
      When loading a vendor library, it will call the new vendor's setDispatchIndex
      callback for every existing GLX dispatch function.
    • Kyle Brenneman's avatar
      Add helper functions for keeping track of the window-system dispatch stubs. · 4d20b182
      Kyle Brenneman authored
      Added a new file, winsys_dispatch.c, with functions for keeping track of the
      indices, names, and dispatch stubs for window-system functions.
      This will replace the __GLXdispatchIndexHash hashtable in GLX.
      It's independant of the window system, so it should be usable for EGL as well.
  6. 11 May, 2016 2 commits
    • Kyle Brenneman's avatar
      Remove the reference to glx.h from libopengl.c. · 509de0db
      Kyle Brenneman authored
      libOpenGL doesn't contain anything GLX-specific, so it doesn't need anything
      defined in glx.h.
    • Kyle Brenneman's avatar
      Merge pull request #84 from kbrenneman/fix-automake-warnings · d4154859
      Kyle Brenneman authored
      Fix the warnings that autogen.sh spits out.
      Added libtool convenience libraries for the source files in src/util instead of
      including them directly in other makefiles. This avoids a bunch of
      subdir-objects warnings.
      Added libtool convenience libraries for each of the glapi builds.
      Flattened the vnd-glapi directory. In theory, just setting the subdir-objects
      flag should be enough, but that causes failures where "make distcheck" doesn't
      build all of the source files.
  7. 04 May, 2016 3 commits
  8. 26 Apr, 2016 1 commit
  9. 24 Apr, 2016 1 commit
    • Thomas Andersen's avatar
      GLX: fix a read after free · b0b4e351
      Thomas Andersen authored
      In MergeExtensionStrings currentString was read after it was realloc'ed
      to make space for the extra extensions.
      This patch makes the function read the realloc'ed memory instead. To
      allow that to work 'buf' has to be null terminated on after every
      extra extension is written.
  10. 23 Apr, 2016 1 commit
  11. 19 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      Move vnd-glapi/mapi/* to vnd-glapi. · fa2add82
      Kyle Brenneman authored
      Moved everything under src/GLdispatch/vnd-glapi/mapi/ to
      Removed the subdir-objects flag.
      Using subdir-objects causes errors when you do a make followed by a
      "make distcheck", because for some reason the distcheck doesn't build all of
      the source files.
  12. 07 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      GLESv1: Statically export glPointSizePointerOES. · 65440c05
      Kyle Brenneman authored
      Add GL_OES_point_size_array to the set of features and extensions that are
      exported from libGLESv1_CM.so.
      According to the OpenGL ES 1.1 spec, all required extensions are supposed to be
      statically exported from the library. GL_OES_point_size_array is the only
      required extension that defines any functions.
  13. 06 Apr, 2016 6 commits
  14. 05 Apr, 2016 1 commit
  15. 04 Apr, 2016 1 commit
  16. 03 Apr, 2016 1 commit
  17. 01 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Don't call into the vendor library from __glXFini. · b7d75429
      Kyle Brenneman authored
      By the time __glXFini is called, the destructors in the vendor libraries may
      have already been called, so it's not safe to call any functions in the vendor
      __glXFini will now check for a fork and go through fork recovery, but it won't
      call __glDispatchCheckMultithreaded. If there was a current context, then
      __glDispatchCheckMultithreaded might call the vendor's thread attach callback.
  18. 30 Mar, 2016 2 commits