Skip to content
  • Brian Nguyen's avatar
    [GLdispatch] Patch entrypoints on make current · 3fa81a5f
    Brian Nguyen authored
    Modify __glDispatchMakeCurrent() to take a pointer to the patch
    callbacks for the vendor library whose context is about to be current.
    
    Implement GLdispatch.c:PatchEntrypoints() and helpers.  This contains
    the logic for determining whether it is safe to patch entrypoints, and
    using the provided vendor callbacks to actually do the entrypoint
    patching.  Call this from __glDispatchMakeCurrent() with the provided
    patch callbacks.
    
    Also implement GLdispatch.c:CurrentEntrypointsSafeToUse(), which
    determines based on the current vendor ID whether the current top-level
    code is safe to use with that vendor.  If this check fails, the make
    current operation fails.
    
    Allow users to disable entrypoint rewriting functionality by setting the
    environment variable __GLVND_DISALLOW_PATCHING=1.
    
    When losing current, also attempt to restore the default libglvnd
    entrypoints so other vendors can potentially use them.
    3fa81a5f