Blame include/glvnd/libglxabi.h

Packit Service 9e77c8
/*
Packit Service 9e77c8
 * Copyright (c) 2013, NVIDIA CORPORATION.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 9e77c8
 * copy of this software and/or associated documentation files (the
Packit Service 9e77c8
 * "Materials"), to deal in the Materials without restriction, including
Packit Service 9e77c8
 * without limitation the rights to use, copy, modify, merge, publish,
Packit Service 9e77c8
 * distribute, sublicense, and/or sell copies of the Materials, and to
Packit Service 9e77c8
 * permit persons to whom the Materials are furnished to do so, subject to
Packit Service 9e77c8
 * the following conditions:
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * The above copyright notice and this permission notice shall be included
Packit Service 9e77c8
 * unaltered in all copies or substantial portions of the Materials.
Packit Service 9e77c8
 * Any additions, deletions, or changes to the original source files
Packit Service 9e77c8
 * must be clearly indicated in accompanying documentation.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * If only executable code is distributed, then the accompanying
Packit Service 9e77c8
 * documentation must state that "this software is based in part on the
Packit Service 9e77c8
 * work of the Khronos Group."
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit Service 9e77c8
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit Service 9e77c8
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Packit Service 9e77c8
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
Packit Service 9e77c8
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Packit Service 9e77c8
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Packit Service 9e77c8
 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
Packit Service 9e77c8
 */
Packit Service 9e77c8
Packit Service 9e77c8
#if !defined(__LIB_GLX_ABI_H)
Packit Service 9e77c8
#define __LIB_GLX_ABI_H
Packit Service 9e77c8
Packit Service 9e77c8
#include <stdint.h>
Packit Service 9e77c8
#include <GL/glx.h>
Packit Service 9e77c8
Packit Service 9e77c8
#include "glvnd/GLdispatchABI.h"
Packit Service 9e77c8
Packit Service 9e77c8
#if defined(__cplusplus)
Packit Service 9e77c8
extern "C" {
Packit Service 9e77c8
#endif
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * \defgroup glxvendorabi GLX Vendor ABI
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * Definition of ABI exported by libGLX.so to libGLX_VENDOR.so libraries.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * Each vendor is associated with three distinct dispatch table types:
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * - static GLX dispatch table: this is the fixed list of GLX 1.4 entrypoints
Packit Service 9e77c8
 *   provided by the vendor at load time during the initial handshake.
Packit Service 9e77c8
 * - dynamic GLX dispatch table: this is a structure allocated by the API
Packit Service 9e77c8
 *   library at runtime used to manage GLX extension functions which are not
Packit Service 9e77c8
 *   present in the static table.
Packit Service 9e77c8
 * - core GL dispatch table: this is a structure maintained by the API library
Packit Service 9e77c8
 *   which contains both GL core (static) and GL extension (dynamic) functions.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * Note that while the implementations of most GLX functions in a vendor
Packit Service 9e77c8
 * library is mostly unchanged from a traditional, single-vendor driver, libGLX
Packit Service 9e77c8
 * has additional requirements for GLXContext and GLXFBConfig handle values.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * First, all GLXContext and GLXFBConfig handles have to be unique between
Packit Service 9e77c8
 * vendor libraries. That is, every GLXContext or GLXFBConfig handle must map
Packit Service 9e77c8
 * to exactly one vendor library, so that libGLX knows which library to dispatch
Packit Service 9e77c8
 * to.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * To do that, all GLXContext and GLXFBConfig handles *must* be a pointer to an
Packit Service 9e77c8
 * address that the vendor library somehow controls. The address doesn't need
Packit Service 9e77c8
 * to be readable or writable, but it must be an address that no other vendor
Packit Service 9e77c8
 * library would use.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * The address could be a pointer to a structure, or an address in a statically
Packit Service 9e77c8
 * or dynamically allocated array. It could even be a file mapping, or even an
Packit Service 9e77c8
 * offset into wherever the vendor library itself is mapped.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * A vendor library may not, however, use anything like an index or an XID for
Packit Service 9e77c8
 * a GLXContext or GLXFBConfig handle.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * GLXContext handles must also be globally unique across all display
Packit Service 9e77c8
 * connections in the entire process. That is, a vendor library may not return
Packit Service 9e77c8
 * the same GLXContext handle for two different contexts, even if they're on
Packit Service 9e77c8
 * different displays or different servers.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * GLXFBConfigs may be duplicated between multiple displays, as long as they
Packit Service 9e77c8
 * are still unique between vendors. Some applications even depend on this:
Packit Service 9e77c8
 * They will look up a GLXFBConfig handle with one connection, and then try to
Packit Service 9e77c8
 * use that config on another connection.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * @{
Packit Service 9e77c8
 */
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * Current version of the ABI.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * This version number contains a major number in the high-order 16 bits, and
Packit Service 9e77c8
 * a minor version number in the low-order 16 bits.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * The major version number is incremented when an interface change will break
Packit Service 9e77c8
 * backwards compatibility with existing vendor libraries. The minor version
Packit Service 9e77c8
 * number is incremented when there's a change but existing vendor libraries
Packit Service 9e77c8
 * will still work.
Packit Service 9e77c8
 */
Packit Service 9e77c8
#define GLX_VENDOR_ABI_MAJOR_VERSION ((uint32_t) 1)
Packit Service 9e77c8
#define GLX_VENDOR_ABI_MINOR_VERSION ((uint32_t) 0)
Packit Service 9e77c8
#define GLX_VENDOR_ABI_VERSION ((GLX_VENDOR_ABI_MAJOR_VERSION << 16) | GLX_VENDOR_ABI_MINOR_VERSION)
Packit Service 9e77c8
static inline uint32_t GLX_VENDOR_ABI_GET_MAJOR_VERSION(uint32_t version)
Packit Service 9e77c8
{
Packit Service 9e77c8
    return version >> 16;
Packit Service 9e77c8
}
Packit Service 9e77c8
static inline uint32_t GLX_VENDOR_ABI_GET_MINOR_VERSION(uint32_t version)
Packit Service 9e77c8
{
Packit Service 9e77c8
    return version & 0xFFFF;
Packit Service 9e77c8
}
Packit Service 9e77c8
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * This opaque structure stores function pointers for GLX extension functions.
Packit Service 9e77c8
 * It is allocated at runtime by the API library. Vendor-provided dispatch
Packit Service 9e77c8
 * functions retrieve and operate on this structure using the API below.
Packit Service 9e77c8
 */
Packit Service 9e77c8
typedef struct __GLXvendorInfoRec __GLXvendorInfo;
Packit Service 9e77c8
Packit Service 9e77c8
/****************************************************************************
Packit Service 9e77c8
 * API library exports                                                      *
Packit Service 9e77c8
 ****************************************************************************/
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * Functions exported by libGLX.so.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * These functions are exported by libGLX, and should be used by the
Packit Service 9e77c8
 * vendor-implemented dispatch functions to lookup and call into the right
Packit Service 9e77c8
 * vendor.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * These functions should only be called from the GLX dispatch functions, never
Packit Service 9e77c8
 * from the actual implementation of any function. libGLX.so may be holding a
Packit Service 9e77c8
 * non-recursive lock when it calls into the vendor library, so trying to call
Packit Service 9e77c8
 * back into libGLX could deadlock.
Packit Service 9e77c8
 */
Packit Service 9e77c8
typedef struct __GLXapiExportsRec {
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This fetches the appropriate dynamic GLX dispatch table given the display
Packit Service 9e77c8
     * and screen number.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    __GLXvendorInfo *(*getDynDispatch)(Display *dpy,
Packit Service 9e77c8
                                                 const int screen);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This function retrieves the appropriate current dynamic dispatch table,
Packit Service 9e77c8
     * if a GL context is current. Otherwise, this returns NULL.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    __GLXvendorInfo *(*getCurrentDynDispatch)(void);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This function retrieves an entry point from the dynamic dispatch table
Packit Service 9e77c8
     * given an index into the table.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    __GLXextFuncPtr           (*fetchDispatchEntry)
Packit Service 9e77c8
        (__GLXvendorInfo *dynDispatch, int index);
Packit Service 9e77c8
Packit Service 9e77c8
    /************************************************************************
Packit Service 9e77c8
     * This routine is used by the vendor to lookup its context structure.
Packit Service 9e77c8
     * The contents of this structure are opaque to the API library and
Packit Service 9e77c8
     * vendor-dependent.
Packit Service 9e77c8
     ************************************************************************/
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This retrieves the current context for this thread.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    GLXContext                (*getCurrentContext)(void);
Packit Service 9e77c8
Packit Service 9e77c8
    /************************************************************************
Packit Service 9e77c8
     * These routines are used by vendor dispatch functions to look up
Packit Service 9e77c8
     * and add mappings between various objects and vendors.
Packit Service 9e77c8
     ************************************************************************/
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * Records the vendor for a context. The vendor must be the one returned
Packit Service 9e77c8
     * for the XVisualInfo or GLXFBConfig that the context is created from.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param dpy The display pointer.
Packit Service 9e77c8
     * \param context The context handle.
Packit Service 9e77c8
     * \param vendor The vendor that created the context.
Packit Service 9e77c8
     * \return Zero on success, non-zero on error.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    int (*addVendorContextMapping)(Display *dpy, GLXContext context, __GLXvendorInfo *vendor);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * Removes a mapping from context to vendor. The context must have been
Packit Service 9e77c8
     * added with \p addVendorContextMapping.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void (*removeVendorContextMapping)(Display *dpy, GLXContext context);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * Looks up the vendor for a context.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * If no mapping is found, then this function will return \c NULL. No
Packit Service 9e77c8
     * errors are raised, so the dispatch function must raise any appropriate X
Packit Service 9e77c8
     * errors.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * Note that this function does not take a display connection, since
Packit Service 9e77c8
     * there are cases (e.g., glXGetContextIDEXT) that take a GLXContext but
Packit Service 9e77c8
     * not a display.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param context The context to look up.
Packit Service 9e77c8
     * \return The vendor for the context, or NULL if no matching context was
Packit Service 9e77c8
     * found.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    __GLXvendorInfo * (*vendorFromContext)(GLXContext context);
Packit Service 9e77c8
Packit Service 9e77c8
    int (*addVendorFBConfigMapping)(Display *dpy, GLXFBConfig config, __GLXvendorInfo *vendor);
Packit Service 9e77c8
    void (*removeVendorFBConfigMapping)(Display *dpy, GLXFBConfig config);
Packit Service 9e77c8
    __GLXvendorInfo * (*vendorFromFBConfig)(Display *dpy, GLXFBConfig config);
Packit Service 9e77c8
Packit Service 9e77c8
    int (*addVendorDrawableMapping)(Display *dpy, GLXDrawable drawable, __GLXvendorInfo *vendor);
Packit Service 9e77c8
    void (*removeVendorDrawableMapping)(Display *dpy, GLXDrawable drawable);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * Looks up the vendor for a drawable.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * If the drawable was created from another GLX function, then this will
Packit Service 9e77c8
     * return the same vendor library that was used to create it.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * If the drawable was not created from GLX (a regular X window, for
Packit Service 9e77c8
     * example), then libGLX.so will use the x11glvnd server extension to
Packit Service 9e77c8
     * figure out a vendor library.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * All of this should be opaque to a dispatch function, since the only
Packit Service 9e77c8
     * thing that matters is finding out which vendor to dispatch to.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    __GLXvendorInfo * (*vendorFromDrawable)(Display *dpy, GLXDrawable drawable);
Packit Service 9e77c8
Packit Service 9e77c8
} __GLXapiExports;
Packit Service 9e77c8
Packit Service 9e77c8
/*****************************************************************************
Packit Service 9e77c8
 * API library imports                                                       *
Packit Service 9e77c8
 *****************************************************************************/
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * This structure stores required and optional vendor library callbacks.
Packit Service 9e77c8
 */
Packit Service 9e77c8
typedef struct __GLXapiImportsRec {
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * Checks if the vendor library can support a given X screen. If this
Packit Service 9e77c8
     * returns false, then libGLX will fall back to the indirect rendering
Packit Service 9e77c8
     * library (if one exists).
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param dpy The display connection.
Packit Service 9e77c8
     * \param screen The screen number.
Packit Service 9e77c8
     * \return True if the vendor library can support this screen.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    Bool (* isScreenSupported) (Display *dpy, int screen);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This retrieves the pointer to the real GLX or core GL function.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param procName The name of the function.
Packit Service 9e77c8
     * \return A pointer to a function, or \c NULL if the vendor does not
Packit Service 9e77c8
     * support the function.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void        *(*getProcAddress)        (const GLubyte *procName);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This retrieves vendor-neutral functions which use the
Packit Service 9e77c8
     * __GLXdispatchTableDynamic API above to dispatch to the correct vendor.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * A vendor library must provide a dispatch function for all GLX functions
Packit Service 9e77c8
     * that it supports. If \c getDispatchAddress returns NULL, but
Packit Service 9e77c8
     * \c getProcAddress returns non-NULL, then libGLX will assume that the
Packit Service 9e77c8
     * function is a GL function, not GLX.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * That allows libGLX to dispatch GL and GLX functions correctly, even in
Packit Service 9e77c8
     * the case of a GL function that starts with "glX".
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param procName The name of the function.
Packit Service 9e77c8
     * \return A pointer to a function, or \c NULL if the vendor does not
Packit Service 9e77c8
     * support the function or \p procName is not a GLX function.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void        *(*getDispatchAddress)    (const GLubyte *procName);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * This notifies the vendor library which dispatch table index is
Packit Service 9e77c8
     * assigned to a particular GLX extension function.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void        (*setDispatchIndex)      (const GLubyte *procName, int index);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * (OPTIONAL) This notifies the vendor library when an X error was
Packit Service 9e77c8
     * generated due to a detected error in the GLX API stream.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * This may be \c NULL, in which case the vendor library is not notified of
Packit Service 9e77c8
     * any errors.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \note this is a notification only -- libGLX takes care of actually
Packit Service 9e77c8
     * reporting the error.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param dpy The display connection.
Packit Service 9e77c8
     * \param error The error code.
Packit Service 9e77c8
     * \param resid The XID associated with the error, if any.
Packit Service 9e77c8
     * \param opcode The minor opcode of the function that generated the error.
Packit Service 9e77c8
     * \param coreX11error True if the error code is a core X11 error, or False
Packit Service 9e77c8
     * if it's a GLX error code.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \return True if libGLX should report the error to the application.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    Bool        (*notifyError)  (Display *dpy, unsigned char error,
Packit Service 9e77c8
                                 XID resid, unsigned char opcode,
Packit Service 9e77c8
                                 Bool coreX11error);
Packit Service 9e77c8
Packit Service 9e77c8
    /*
Packit Service 9e77c8
     * The vendor library may use the isPatchSupported, initiatePatch,
Packit Service 9e77c8
     * releasePatch, and patchThreadAttach callbacks to re-write libglvnd's
Packit Service 9e77c8
     * entrypoints at make current time, provided no other contexts are current
Packit Service 9e77c8
     * and the TLS model supports this functionality. This is a performance
Packit Service 9e77c8
     * optimization that may not be available at runtime; the vendor library
Packit Service 9e77c8
     * must not depend on this functionality for correctness.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * To use this optimization, the vendor library must provide at least the
Packit Service 9e77c8
     * isPatchSupported and initiatePatch entrypoints.
Packit Service 9e77c8
     */
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * (OPTIONAL) Checks to see if the vendor library supports patching the
Packit Service 9e77c8
     * given stub type and size.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param type The type of entrypoints. This will be a one of the
Packit Service 9e77c8
     * __GLDISPATCH_STUB_* values.
Packit Service 9e77c8
     * \param stubSize The maximum size of the stub that the vendor library can
Packit Service 9e77c8
     * write, in bytes.
Packit Service 9e77c8
     * \param lookupStubOffset A callback into libglvnd to look up the address
Packit Service 9e77c8
     * of each entrypoint.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    GLboolean (* isPatchSupported)(int type, int stubSize);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * (OPTIONAL) Called by libglvnd to request that a vendor library patch its
Packit Service 9e77c8
     * top-level entrypoints.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * The vendor library should use the \p lookupStubOffset callback to find
Packit Service 9e77c8
     * the addresses of each entrypoint.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * This function may be called more than once to patch multiple sets of
Packit Service 9e77c8
     * entrypoints. For example, depending on how they're built, libOpenGL.so
Packit Service 9e77c8
     * or libGL.so may have their own entrypoints that are separate functions
Packit Service 9e77c8
     * from the ones in libGLdispatch.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * Note that during this call is the only time that the entrypoints can be
Packit Service 9e77c8
     * modified. After the call to \c initiatePatch returns, the vendor library
Packit Service 9e77c8
     * should treat the entrypoints as read-only.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \param type The type of entrypoints. This will be a one of the
Packit Service 9e77c8
     * __GLDISPATCH_STUB_* values.
Packit Service 9e77c8
     * \param stubSize The maximum size of the stub that the vendor library can
Packit Service 9e77c8
     * write, in bytes.
Packit Service 9e77c8
     * \param lookupStubOffset A callback into libglvnd to look up the address
Packit Service 9e77c8
     * of each entrypoint.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \return GL_TRUE if the vendor library supports patching with this type
Packit Service 9e77c8
     * and size.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    GLboolean (*initiatePatch)(int type,
Packit Service 9e77c8
                               int stubSize,
Packit Service 9e77c8
                               DispatchPatchLookupStubOffset lookupStubOffset);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * (OPTIONAL) Called by libglvnd to notify the current vendor that it no
Packit Service 9e77c8
     * longer owns the top-level entrypoints.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * Libglvnd will take care of the restoring the entrypoints back to their
Packit Service 9e77c8
     * original state. The vendor library must not try to modify them.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void (*releasePatch)(void);
Packit Service 9e77c8
Packit Service 9e77c8
    /*!
Packit Service 9e77c8
     * (OPTIONAL) Called at the start of window-system functions (GLX and EGL).
Packit Service 9e77c8
     * This callback allows vendor libraries to perform any per-thread
Packit Service 9e77c8
     * initialization.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * This is basically a workaround for broken applications. A lot of apps
Packit Service 9e77c8
     * will make one or more invalid GLX/EGL calls on a thread (often including
Packit Service 9e77c8
     * a MakeCurrent with invalid parameters), and then will try to call an
Packit Service 9e77c8
     * OpenGL function.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * A non-libglvnd-based driver would be able to initialize any thread state
Packit Service 9e77c8
     * even on a bogus GLX call, but with libglvnd, those calls wouldn't get
Packit Service 9e77c8
     * past libGLX.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * This function is optional. If it's \c NULL, then libGLdispatch will
Packit Service 9e77c8
     * simply ignore it.
Packit Service 9e77c8
     *
Packit Service 9e77c8
     * \note This function may be called concurrently from multiple threads.
Packit Service 9e77c8
     */
Packit Service 9e77c8
    void (*patchThreadAttach)(void);
Packit Service 9e77c8
Packit Service 9e77c8
} __GLXapiImports;
Packit Service 9e77c8
Packit Service 9e77c8
/*****************************************************************************/
Packit Service 9e77c8
Packit Service 9e77c8
#define __GLX_MAIN_PROTO_NAME "__glx_Main"
Packit Service 9e77c8
#define __GLX_MAIN_PROTO(version, exports, vendor, imports) \
Packit Service 9e77c8
    Bool __glx_Main(uint32_t version, \
Packit Service 9e77c8
                    const __GLXapiExports *exports, \
Packit Service 9e77c8
                    __GLXvendorInfo *vendor, \
Packit Service 9e77c8
                    __GLXapiImports *imports)
Packit Service 9e77c8
Packit Service 9e77c8
typedef Bool (*__PFNGLXMAINPROC)
Packit Service 9e77c8
    (uint32_t version, const __GLXapiExports *exports, __GLXvendorInfo *vendor, __GLXapiImports *imports);
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * Vendor libraries must export a function called __glx_Main() with the
Packit Service 9e77c8
 * following prototype.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * This function also performs a handshake based on the ABI version number.
Packit Service 9e77c8
 * Vendor libraries can optionally use the version number to support older
Packit Service 9e77c8
 * versions of the ABI.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * \param[in] version The ABI version. The upper 16 bits contains the major version
Packit Service 9e77c8
 * number, and the lower 16 bits contains the minor version number.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * \param[in] exports The table of functions provided by libGLX. This pointer will
Packit Service 9e77c8
 * remain valid for as long as the vendor is loaded.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * \param[in] vendor The opaque pointer used to identify this vendor library. This
Packit Service 9e77c8
 * may be used in future versions to provide additional per-vendor information.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * \param[out] imports The function table that the vendor library should fill
Packit Service 9e77c8
 * in. The vendor library must assign every non-optional function in the
Packit Service 9e77c8
 * struct.
Packit Service 9e77c8
 *
Packit Service 9e77c8
 * \return True on success. If the vendor library does not support the
Packit Service 9e77c8
 * requested ABI version or if some other error occurs, then it should return
Packit Service 9e77c8
 * False.
Packit Service 9e77c8
 */
Packit Service 9e77c8
Bool __glx_Main(uint32_t version,
Packit Service 9e77c8
                                  const __GLXapiExports *exports,
Packit Service 9e77c8
                                  __GLXvendorInfo *vendor,
Packit Service 9e77c8
                                  __GLXapiImports *imports);
Packit Service 9e77c8
Packit Service 9e77c8
/*!
Packit Service 9e77c8
 * @}
Packit Service 9e77c8
 */
Packit Service 9e77c8
Packit Service 9e77c8
#if defined(__cplusplus)
Packit Service 9e77c8
}
Packit Service 9e77c8
#endif
Packit Service 9e77c8
Packit Service 9e77c8
#endif /* __LIB_GLX_ABI_H */