2004-10-25 22:09:16 +01:00
|
|
|
/*
|
Update to SGI FreeB 2.0.
Under the terms of version 1.1, "once Covered Code has been published
under a particular version of the License, Recipient may, for the
duration of the License, continue to use it under the terms of that
version, or choose to use such Covered Code under the terms of any
subsequent version published by SGI."
FreeB 2.0 license refers to "dates of first publication". They are here
taken to be 1991-2000, as noted in the original license text:
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
Official FreeB 2.0 text:
http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf
As always, this code has not been tested for conformance with the OpenGL
specification. OpenGL conformance testing is available from
http://khronos.org/ and is required for use of the OpenGL logo in
product advertising and promotion.
2008-09-19 22:16:53 +01:00
|
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice including the dates of first publication and
|
|
|
|
* either this permission notice or a reference to
|
|
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
|
|
* shall be included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
* other dealings in this Software without prior written authorization from
|
|
|
|
* Silicon Graphics, Inc.
|
|
|
|
*/
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \file glxclient.h
|
|
|
|
* Direct rendering support added by Precision Insight, Inc.
|
|
|
|
*
|
|
|
|
* \author Kevin E. Martin <kevin@precisioninsight.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GLX_client_h_
|
|
|
|
#define _GLX_client_h_
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include <X11/Xlibint.h>
|
2010-07-28 15:20:41 +01:00
|
|
|
#include <X11/Xfuncproto.h>
|
2010-01-20 03:01:14 +00:00
|
|
|
#include <X11/extensions/extutil.h>
|
2004-10-25 22:09:16 +01:00
|
|
|
#define GLX_GLXEXT_PROTOTYPES
|
|
|
|
#include <GL/glx.h>
|
|
|
|
#include <GL/glxext.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2004-11-15 15:31:32 +00:00
|
|
|
#include <stdint.h>
|
2015-03-06 16:54:59 +00:00
|
|
|
#include <pthread.h>
|
2004-10-25 22:09:16 +01:00
|
|
|
#include "GL/glxproto.h"
|
2010-07-28 15:13:44 +01:00
|
|
|
#include "glxconfig.h"
|
2007-01-07 13:12:01 +00:00
|
|
|
#include "glxhash.h"
|
2015-03-03 16:51:19 +00:00
|
|
|
#include "util/macros.h"
|
2021-05-21 21:23:07 +01:00
|
|
|
#include "util/u_thread.h"
|
2022-02-07 09:54:57 +00:00
|
|
|
#include "util/set.h"
|
2021-04-20 03:43:46 +01:00
|
|
|
#include "loader.h"
|
2008-08-08 10:37:14 +01:00
|
|
|
#include "glxextensions.h"
|
|
|
|
|
2017-01-04 18:31:58 +00:00
|
|
|
#if defined(USE_LIBGLVND)
|
2016-05-11 19:01:53 +01:00
|
|
|
#define _GLX_PUBLIC _X_HIDDEN
|
|
|
|
#else
|
|
|
|
#define _GLX_PUBLIC _X_EXPORT
|
|
|
|
#endif
|
2008-09-18 20:26:30 +01:00
|
|
|
|
2016-04-26 19:48:12 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-04-20 03:43:46 +01:00
|
|
|
extern void glx_message(int level, const char *f, ...) PRINTFLIKE(2, 3);
|
|
|
|
|
2021-04-20 03:53:38 +01:00
|
|
|
#define DebugMessageF(...) glx_message(_LOADER_DEBUG, __VA_ARGS__)
|
2021-04-20 03:43:46 +01:00
|
|
|
#define InfoMessageF(...) glx_message(_LOADER_INFO, __VA_ARGS__)
|
|
|
|
#define ErrorMessageF(...) glx_message(_LOADER_WARNING, __VA_ARGS__)
|
|
|
|
#define CriticalErrorMessageF(...) glx_message(_LOADER_FATAL, __VA_ARGS__)
|
|
|
|
|
2016-04-26 19:48:12 +01:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
#define GLX_MAJOR_VERSION 1 /* current version numbers */
|
|
|
|
#define GLX_MINOR_VERSION 4
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_display;
|
|
|
|
struct glx_context;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
#ifdef GLX_DIRECT_RENDERING
|
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void DRI_glXUseXFont(struct glx_context *ctx,
|
2010-07-23 03:24:00 +01:00
|
|
|
Font font, int first, int count, int listbase);
|
2010-04-02 09:35:19 +01:00
|
|
|
|
|
|
|
#endif
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-04-02 09:35:19 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Display dependent methods. This structure is initialized during the
|
|
|
|
* \c driCreateDisplay call.
|
|
|
|
*/
|
2008-03-09 00:02:10 +00:00
|
|
|
typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
|
2008-03-09 01:34:24 +00:00
|
|
|
typedef struct __GLXDRIscreenRec __GLXDRIscreen;
|
2008-03-09 02:02:23 +00:00
|
|
|
typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
|
2008-03-09 01:34:24 +00:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
struct __GLXDRIdisplayRec
|
|
|
|
{
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Method to destroy the private DRI display data.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
void (*destroyDisplay) (__GLXDRIdisplay * display);
|
2008-03-09 00:15:50 +00:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_screen *(*createScreen)(int screen, struct glx_display * priv);
|
2008-03-09 01:34:24 +00:00
|
|
|
};
|
|
|
|
|
2009-09-16 07:23:09 +01:00
|
|
|
struct __GLXDRIscreenRec {
|
|
|
|
|
2010-07-28 15:28:43 +01:00
|
|
|
void (*destroyScreen)(struct glx_screen *psc);
|
2009-09-16 07:23:09 +01:00
|
|
|
|
2010-07-28 15:28:43 +01:00
|
|
|
__GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc,
|
2009-09-16 07:23:09 +01:00
|
|
|
XID drawable,
|
|
|
|
GLXDrawable glxDrawable,
|
2021-11-09 09:19:44 +00:00
|
|
|
int type,
|
2010-07-28 15:07:52 +01:00
|
|
|
struct glx_config *config);
|
2009-09-16 07:23:09 +01:00
|
|
|
|
|
|
|
int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
2012-11-13 16:06:37 +00:00
|
|
|
int64_t divisor, int64_t remainder, Bool flush);
|
2009-09-16 07:23:09 +01:00
|
|
|
void (*copySubBuffer)(__GLXDRIdrawable *pdraw,
|
2012-11-13 16:06:37 +00:00
|
|
|
int x, int y, int width, int height, Bool flush);
|
2010-07-28 15:28:43 +01:00
|
|
|
int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
2009-09-16 07:23:09 +01:00
|
|
|
int64_t *ust, int64_t *msc, int64_t *sbc);
|
|
|
|
int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
|
|
|
int64_t divisor, int64_t remainder, int64_t *ust,
|
|
|
|
int64_t *msc, int64_t *sbc);
|
|
|
|
int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
|
|
|
|
int64_t *msc, int64_t *sbc);
|
2010-07-19 21:39:53 +01:00
|
|
|
int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval);
|
2009-11-10 21:28:01 +00:00
|
|
|
int (*getSwapInterval)(__GLXDRIdrawable *pdraw);
|
2014-02-24 19:44:42 +00:00
|
|
|
int (*getBufferAge)(__GLXDRIdrawable *pdraw);
|
2021-03-19 17:39:01 +00:00
|
|
|
void (*bindTexImage)(__GLXDRIdrawable *pdraw, int buffer, const int *attribs);
|
|
|
|
void (*releaseTexImage)(__GLXDRIdrawable *pdraw, int buffer);
|
2022-04-28 22:19:13 +01:00
|
|
|
|
|
|
|
int maxSwapInterval;
|
2008-03-09 02:02:23 +00:00
|
|
|
};
|
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
struct __GLXDRIdrawableRec
|
|
|
|
{
|
|
|
|
void (*destroyDrawable) (__GLXDRIdrawable * drawable);
|
2008-03-12 06:18:12 +00:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
XID xDrawable;
|
|
|
|
XID drawable;
|
2010-07-28 15:28:43 +01:00
|
|
|
struct glx_screen *psc;
|
2009-08-12 11:41:22 +01:00
|
|
|
GLenum textureTarget;
|
|
|
|
GLenum textureFormat; /* EXT_texture_from_pixmap support */
|
2010-07-14 17:01:49 +01:00
|
|
|
unsigned long eventMask;
|
2011-06-15 23:09:12 +01:00
|
|
|
int refcount;
|
2004-10-25 22:09:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Function to create and DRI display data and initialize the display
|
|
|
|
** dependent methods.
|
|
|
|
*/
|
2022-03-15 19:35:19 +00:00
|
|
|
extern __GLXDRIdisplay *driswCreateDisplay(Display * dpy, bool zink);
|
2009-08-12 11:41:22 +01:00
|
|
|
extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy);
|
2016-07-11 21:38:16 +01:00
|
|
|
extern __GLXDRIdisplay *dri3_create_display(Display * dpy);
|
|
|
|
extern __GLXDRIdisplay *driwindowsCreateDisplay(Display * dpy);
|
|
|
|
|
|
|
|
/*
|
|
|
|
**
|
|
|
|
*/
|
2010-02-08 18:27:56 +00:00
|
|
|
extern void dri2InvalidateBuffers(Display *dpy, XID drawable);
|
2010-09-22 06:44:59 +01:00
|
|
|
extern unsigned dri2GetSwapEventType(Display *dpy, XID drawable);
|
2010-02-08 18:27:56 +00:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/*
|
|
|
|
** Functions to obtain driver configuration information from a direct
|
|
|
|
** rendering client application
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
extern const char *glXGetScreenDriver(Display * dpy, int scrNum);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
extern const char *glXGetDriverConfig(const char *driverName);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
|
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
typedef struct __GLXpixelStoreModeRec
|
|
|
|
{
|
|
|
|
GLboolean swapEndian;
|
|
|
|
GLboolean lsbFirst;
|
|
|
|
GLuint rowLength;
|
|
|
|
GLuint imageHeight;
|
|
|
|
GLuint imageDepth;
|
|
|
|
GLuint skipRows;
|
|
|
|
GLuint skipPixels;
|
|
|
|
GLuint skipImages;
|
|
|
|
GLuint alignment;
|
2004-10-25 22:09:16 +01:00
|
|
|
} __GLXpixelStoreMode;
|
|
|
|
|
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
typedef struct __GLXattributeRec
|
|
|
|
{
|
|
|
|
GLuint mask;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2005-02-22 22:36:31 +00:00
|
|
|
* Pixel storage state. Most of the pixel store mode state is kept
|
|
|
|
* here and used by the client code to manage the packing and
|
|
|
|
* unpacking of data sent to/received from the server.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
__GLXpixelStoreMode storePack, storeUnpack;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2005-02-22 22:36:31 +00:00
|
|
|
* Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
|
|
|
|
* disabled?
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLboolean NoDrawArraysProtocol;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
2005-02-22 22:36:31 +00:00
|
|
|
* Vertex Array storage state. The vertex array component
|
|
|
|
* state is stored here and is used to manage the packing of
|
|
|
|
* DrawArrays data sent to the server.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
struct array_state_vector *array_state;
|
2004-10-25 22:09:16 +01:00
|
|
|
} __GLXattribute;
|
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
typedef struct __GLXattributeMachineRec
|
|
|
|
{
|
|
|
|
__GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
|
|
|
|
__GLXattribute **stackPointer;
|
2004-10-25 22:09:16 +01:00
|
|
|
} __GLXattributeMachine;
|
|
|
|
|
2016-05-30 10:56:33 +01:00
|
|
|
struct mesa_glinterop_device_info;
|
|
|
|
struct mesa_glinterop_export_in;
|
|
|
|
struct mesa_glinterop_export_out;
|
2016-03-03 17:43:53 +00:00
|
|
|
|
2010-05-21 15:36:56 +01:00
|
|
|
struct glx_context_vtable {
|
2010-07-28 16:16:00 +01:00
|
|
|
void (*destroy)(struct glx_context *ctx);
|
2010-07-28 20:33:09 +01:00
|
|
|
int (*bind)(struct glx_context *context, struct glx_context *old,
|
|
|
|
GLXDrawable draw, GLXDrawable read);
|
2011-11-29 01:47:59 +00:00
|
|
|
void (*unbind)(struct glx_context *context, struct glx_context *new_ctx);
|
2010-07-28 16:16:00 +01:00
|
|
|
void (*wait_gl)(struct glx_context *ctx);
|
|
|
|
void (*wait_x)(struct glx_context *ctx);
|
2016-03-03 17:43:53 +00:00
|
|
|
int (*interop_query_device_info)(struct glx_context *ctx,
|
2016-05-30 10:56:33 +01:00
|
|
|
struct mesa_glinterop_device_info *out);
|
2016-03-03 17:43:53 +00:00
|
|
|
int (*interop_export_object)(struct glx_context *ctx,
|
2016-05-30 10:56:33 +01:00
|
|
|
struct mesa_glinterop_export_in *in,
|
|
|
|
struct mesa_glinterop_export_out *out);
|
2010-05-21 15:36:56 +01:00
|
|
|
};
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* GLX state that needs to be kept on the client. One of these records
|
|
|
|
* exist for each context that has been made current by this client.
|
|
|
|
*/
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_context
|
2009-08-12 11:41:22 +01:00
|
|
|
{
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* \name Drawing command buffer.
|
|
|
|
*
|
|
|
|
* Drawing commands are packed into this buffer before being sent as a
|
|
|
|
* single GLX protocol request. The buffer is sent when it overflows or
|
|
|
|
* is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
|
|
|
|
* in the buffer to be filled. \c limit is described above in the buffer
|
|
|
|
* slop discussion.
|
|
|
|
*
|
|
|
|
* Commands that require large amounts of data to be transfered will
|
|
|
|
* also use this buffer to hold a header that describes the large
|
|
|
|
* command.
|
|
|
|
*
|
|
|
|
* These must be the first 6 fields since they are static initialized
|
|
|
|
* in the dummy context in glxext.c
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
|
|
|
GLubyte *buf;
|
|
|
|
GLubyte *pc;
|
|
|
|
GLubyte *limit;
|
|
|
|
GLubyte *bufEnd;
|
|
|
|
GLint bufSize;
|
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-09-07 19:32:28 +01:00
|
|
|
const struct glx_context_vtable *vtable;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* The XID of this rendering context. When the context is created a
|
|
|
|
* new XID is allocated. This is set to None when the context is
|
|
|
|
* destroyed but is still current to some thread. In this case the
|
|
|
|
* context will be freed on next MakeCurrent.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
XID xid;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The XID of the \c shareList context.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
XID share_xid;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Screen number.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLint screen;
|
2010-07-28 15:28:43 +01:00
|
|
|
struct glx_screen *psc;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \c GL_TRUE if the context was created with ImportContext, which
|
|
|
|
* means the server-side context was created by another X client.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLboolean imported;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The context tag returned by MakeCurrent when this context is made
|
|
|
|
* current. This tag is used to identify the context that a thread has
|
|
|
|
* current so that proper server context management can be done. It is
|
|
|
|
* used for all context specific commands (i.e., \c Render, \c RenderLarge,
|
|
|
|
* \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
|
|
|
|
* context)).
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLXContextTag currentContextTag;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \name Rendering mode
|
|
|
|
*
|
|
|
|
* The rendering mode is kept on the client as well as the server.
|
|
|
|
* When \c glRenderMode is called, the buffer associated with the
|
|
|
|
* previous rendering mode (feedback or select) is filled.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
|
|
|
GLenum renderMode;
|
|
|
|
GLfloat *feedbackBuf;
|
|
|
|
GLuint *selectBuf;
|
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2005-07-29 18:30:18 +01:00
|
|
|
* Client side attribs.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
__GLXattributeMachine attributes;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Client side error code. This is set when client side gl API
|
|
|
|
* routines need to set an error because of a bad enumerant or
|
|
|
|
* running out of memory, etc.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLenum error;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2008-03-18 07:02:57 +00:00
|
|
|
/**
|
|
|
|
* Whether this context does direct rendering.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
Bool isDirect;
|
2008-03-18 07:02:57 +00:00
|
|
|
|
2011-06-05 23:02:44 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && defined(GLX_USE_APPLEGL)
|
|
|
|
void *driContext;
|
|
|
|
#endif
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* \c dpy of current display for this context. Will be \c NULL if not
|
|
|
|
* current to any display, or if this is the "dummy context".
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
Display *currentDpy;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current drawable for this context. Will be None if this
|
|
|
|
* context is not current to any drawable. currentReadable is below.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLXDrawable currentDrawable;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \name GL Constant Strings
|
|
|
|
*
|
|
|
|
* Constant strings that describe the server implementation
|
|
|
|
* These pertain to GL attributes, not to be confused with
|
|
|
|
* GLX versioning attributes.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
|
|
|
GLubyte *vendor;
|
|
|
|
GLubyte *renderer;
|
|
|
|
GLubyte *version;
|
|
|
|
GLubyte *extensions;
|
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum small render command size. This is the smaller of 64k and
|
|
|
|
* the size of the above buffer.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLint maxSmallRenderCommandSize;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Major opcode for the extension. Copied here so a lookup isn't
|
|
|
|
* needed.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLint majorOpcode;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2010-07-28 15:07:52 +01:00
|
|
|
* Pointer to the config used to create this context.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2010-07-28 15:07:52 +01:00
|
|
|
struct glx_config *config;
|
2007-01-07 13:12:01 +00:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* The current read-drawable for this context. Will be None if this
|
|
|
|
* context is not current to any drawable.
|
|
|
|
*
|
|
|
|
* \since Internal API version 20030606.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
GLXDrawable currentReadable;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
/**
|
2004-10-25 22:09:16 +01:00
|
|
|
* Pointer to client-state data that is private to libGL. This is only
|
|
|
|
* used for indirect rendering contexts.
|
|
|
|
*
|
|
|
|
* No internal API version change was made for this change. Client-side
|
|
|
|
* drivers should NEVER use this data or even care that it exists.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
void *client_state_private;
|
2005-02-22 22:36:31 +00:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
|
|
|
|
*/
|
|
|
|
int renderType;
|
2009-08-12 11:41:22 +01:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* \name Raw server GL version
|
|
|
|
*
|
|
|
|
* True core GL version supported by the server. This is the raw value
|
|
|
|
* returned by the server, and it may not reflect what is actually
|
|
|
|
* supported (or reported) by the client-side library.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
2004-10-25 22:09:16 +01:00
|
|
|
int server_major; /**< Major version number. */
|
|
|
|
int server_minor; /**< Minor version number. */
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@} */
|
2005-02-22 22:36:31 +00:00
|
|
|
|
2017-08-03 19:07:58 +01:00
|
|
|
/**
|
|
|
|
* GLX_ARB_create_context_no_error setting for this context.
|
|
|
|
* This needs to be kept here to enforce shared context rules.
|
|
|
|
*/
|
|
|
|
Bool noError;
|
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
char gl_extension_bits[__GL_EXT_BYTES];
|
2004-10-25 22:09:16 +01:00
|
|
|
};
|
|
|
|
|
2010-07-23 02:24:14 +01:00
|
|
|
extern Bool
|
2010-07-28 16:16:00 +01:00
|
|
|
glx_context_init(struct glx_context *gc,
|
2010-07-28 15:28:43 +01:00
|
|
|
struct glx_screen *psc, struct glx_config *fbconfig);
|
2010-07-23 02:24:14 +01:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
#define __glXSetError(gc,code) \
|
|
|
|
if (!(gc)->error) { \
|
|
|
|
(gc)->error = code; \
|
|
|
|
}
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The size of the largest drawing command known to the implementation
|
|
|
|
* that will use the GLXRender GLX command. In this case it is
|
|
|
|
* \c glPolygonStipple.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* To keep the implementation fast, the code uses a "limit" pointer
|
|
|
|
* to determine when the drawing command buffer is too full to hold
|
|
|
|
* another fixed size command. This constant defines the amount of
|
|
|
|
* space that must always be available in the drawing command buffer
|
|
|
|
* at all times for the implementation to work. It is important that
|
|
|
|
* the number be just large enough, but not so large as to reduce the
|
|
|
|
* efficacy of the buffer. The "+32" is just to keep the code working
|
|
|
|
* in case somebody counts wrong.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This implementation uses a smaller threshold for switching
|
|
|
|
* to the RenderLarge protocol than the protcol requires so that
|
|
|
|
* large copies don't occur.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
#define __GLX_RENDER_CMD_SIZE_LIMIT 4096
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* One of these records exists per screen of the display. It contains
|
|
|
|
* a pointer to the config data for that screen (if the screen supports GL).
|
|
|
|
*/
|
2010-07-23 21:15:31 +01:00
|
|
|
struct glx_screen_vtable {
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_context *(*create_context)(struct glx_screen *psc,
|
|
|
|
struct glx_config *config,
|
|
|
|
struct glx_context *shareList,
|
|
|
|
int renderType);
|
2011-11-30 21:06:59 +00:00
|
|
|
|
|
|
|
struct glx_context *(*create_context_attribs)(struct glx_screen *psc,
|
|
|
|
struct glx_config *config,
|
|
|
|
struct glx_context *shareList,
|
|
|
|
unsigned num_attrib,
|
|
|
|
const uint32_t *attribs,
|
|
|
|
unsigned *error);
|
2013-02-16 06:35:24 +00:00
|
|
|
int (*query_renderer_integer)(struct glx_screen *psc,
|
|
|
|
int attribute,
|
2013-11-08 16:00:46 +00:00
|
|
|
unsigned int *value);
|
2013-02-16 06:35:24 +00:00
|
|
|
int (*query_renderer_string)(struct glx_screen *psc,
|
|
|
|
int attribute,
|
|
|
|
const char **value);
|
2020-10-16 22:18:18 +01:00
|
|
|
|
|
|
|
char *(*get_driver_name)(struct glx_screen *psc);
|
2010-07-23 21:15:31 +01:00
|
|
|
};
|
|
|
|
|
2010-07-28 15:28:43 +01:00
|
|
|
struct glx_screen
|
2009-08-12 11:41:22 +01:00
|
|
|
{
|
2010-07-23 21:15:31 +01:00
|
|
|
const struct glx_screen_vtable *vtable;
|
2021-08-06 22:53:38 +01:00
|
|
|
const struct glx_context_vtable *context_vtable;
|
2010-07-23 21:15:31 +01:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
2021-04-23 06:17:00 +01:00
|
|
|
* \name Storage for the GLX vendor, version, and extension strings
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2021-04-23 06:17:00 +01:00
|
|
|
/*@{ */
|
2009-08-12 11:41:22 +01:00
|
|
|
const char *serverGLXexts;
|
2021-04-23 06:17:00 +01:00
|
|
|
const char *serverGLXvendor;
|
|
|
|
const char *serverGLXversion;
|
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GLX extension string to be reported to applications. This is the
|
|
|
|
* set of extensions that the application can actually use.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
char *effectiveGLXexts;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_display *display;
|
2010-07-20 02:00:09 +01:00
|
|
|
|
2010-09-07 17:40:37 +01:00
|
|
|
Display *dpy;
|
|
|
|
int scr;
|
2021-10-07 11:14:44 +01:00
|
|
|
bool force_direct_context;
|
2021-10-31 05:02:02 +00:00
|
|
|
bool allow_invalid_glx_destroy_window;
|
2022-02-07 09:54:57 +00:00
|
|
|
bool keep_native_window_glx_drawable;
|
2010-09-07 17:40:37 +01:00
|
|
|
|
2010-04-02 09:35:19 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Per screen direct rendering interface functions and data.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
__GLXDRIscreen *driScreen;
|
2004-10-25 22:09:16 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2007-10-16 21:07:47 +01:00
|
|
|
* Linked list of glx visuals and fbconfigs for this screen.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2010-07-28 15:07:52 +01:00
|
|
|
struct glx_config *visuals, *configs;
|
2005-07-24 07:29:14 +01:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Per-screen dynamic GLX extension tracking. The \c direct_support
|
|
|
|
* field only contains enough bits for 64 extensions. Should libGL
|
|
|
|
* ever need to track more than 64 GLX extensions, we can safely grow
|
2010-07-28 15:28:43 +01:00
|
|
|
* this field. The \c struct glx_screen structure is not used outside
|
2004-10-25 22:09:16 +01:00
|
|
|
* libGL.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
2020-10-20 07:09:57 +01:00
|
|
|
unsigned char direct_support[__GLX_EXT_BYTES];
|
2009-08-12 11:41:22 +01:00
|
|
|
GLboolean ext_list_first_time;
|
2020-10-15 06:55:41 +01:00
|
|
|
|
|
|
|
unsigned char glx_force_enabled[__GLX_EXT_BYTES];
|
|
|
|
unsigned char glx_force_disabled[__GLX_EXT_BYTES];
|
2020-10-20 14:05:24 +01:00
|
|
|
|
|
|
|
unsigned char gl_force_enabled[__GL_EXT_BYTES];
|
|
|
|
unsigned char gl_force_disabled[__GL_EXT_BYTES];
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2007-05-10 20:52:22 +01:00
|
|
|
};
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Per display private data. One of these records exists for each display
|
|
|
|
* that is using the OpenGL (GLX) extension.
|
|
|
|
*/
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_display
|
2009-08-12 11:41:22 +01:00
|
|
|
{
|
2010-07-28 16:16:00 +01:00
|
|
|
struct glx_display *next;
|
2010-07-23 02:11:02 +01:00
|
|
|
|
2021-04-23 05:42:35 +01:00
|
|
|
/* The extension protocol codes */
|
|
|
|
XExtCodes codes;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Back pointer to the display
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
Display *dpy;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2021-04-22 18:10:44 +01:00
|
|
|
* \name Minor Version
|
2004-10-25 22:09:16 +01:00
|
|
|
*
|
2021-04-22 18:10:44 +01:00
|
|
|
* Minor version returned by the server during initialization. The major
|
|
|
|
* version is asserted to be 1 during extension setup.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@{ */
|
2021-04-22 18:10:44 +01:00
|
|
|
int minorVersion;
|
2009-08-12 11:41:22 +01:00
|
|
|
/*@} */
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Configurations of visuals for all screens on this display.
|
|
|
|
* Also, per screen data which now includes the server \c GLX_EXTENSION
|
|
|
|
* string.
|
|
|
|
*/
|
2010-07-28 15:28:43 +01:00
|
|
|
struct glx_screen **screens;
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2011-05-06 18:31:24 +01:00
|
|
|
__glxHashTable *glXDrawHash;
|
|
|
|
|
2010-04-02 09:35:19 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
2010-07-20 02:15:50 +01:00
|
|
|
__glxHashTable *drawHash;
|
|
|
|
|
2022-02-07 09:54:57 +00:00
|
|
|
/**
|
|
|
|
* GLXDrawable created from native window and about to be released.
|
|
|
|
*/
|
|
|
|
struct set *zombieGLXDrawable;
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/**
|
|
|
|
* Per display direct rendering interface functions and data.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
__GLXDRIdisplay *driswDisplay;
|
|
|
|
__GLXDRIdisplay *dri2Display;
|
2013-11-05 02:15:51 +00:00
|
|
|
__GLXDRIdisplay *dri3Display;
|
2004-10-25 22:09:16 +01:00
|
|
|
#endif
|
2016-07-11 21:38:16 +01:00
|
|
|
#ifdef GLX_USE_WINDOWSGL
|
|
|
|
__GLXDRIdisplay *windowsdriDisplay;
|
|
|
|
#endif
|
2004-10-25 22:09:16 +01:00
|
|
|
};
|
|
|
|
|
2011-05-06 18:31:24 +01:00
|
|
|
struct glx_drawable {
|
|
|
|
XID xDrawable;
|
|
|
|
XID drawable;
|
|
|
|
|
|
|
|
uint32_t lastEventSbc;
|
|
|
|
int64_t eventSbcWrap;
|
|
|
|
};
|
|
|
|
|
2010-07-19 19:57:59 +01:00
|
|
|
extern int
|
2010-07-28 15:28:43 +01:00
|
|
|
glx_screen_init(struct glx_screen *psc,
|
2010-07-28 16:16:00 +01:00
|
|
|
int screen, struct glx_display * priv);
|
2011-01-29 23:00:48 +00:00
|
|
|
extern void
|
|
|
|
glx_screen_cleanup(struct glx_screen *psc);
|
2010-07-19 19:57:59 +01:00
|
|
|
|
2010-07-20 12:43:50 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
2010-07-19 14:37:07 +01:00
|
|
|
extern __GLXDRIdrawable *
|
2021-05-03 13:38:02 +01:00
|
|
|
dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id);
|
2010-07-20 12:43:50 +01:00
|
|
|
#endif
|
2007-05-10 20:52:22 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
extern GLubyte *__glXFlushRenderBuffer(struct glx_context *, GLubyte *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glXSendLargeChunk(struct glx_context * gc, GLint requestNumber,
|
2009-08-12 11:41:22 +01:00
|
|
|
GLint totalRequests,
|
|
|
|
const GLvoid * data, GLint dataLen);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glXSendLargeCommand(struct glx_context *, const GLvoid *, GLint,
|
2009-08-12 11:41:22 +01:00
|
|
|
const GLvoid *, GLint);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/* Initialize the GLX extension for dpy */
|
2010-07-28 16:16:00 +01:00
|
|
|
extern struct glx_display *__glXInitialize(Display *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
extern int __glXDebug;
|
|
|
|
|
|
|
|
/* This is per-thread storage in an MT environment */
|
2005-04-18 17:59:53 +01:00
|
|
|
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glXSetCurrentContext(struct glx_context * c);
|
2005-04-18 17:59:53 +01:00
|
|
|
|
2021-05-21 21:23:07 +01:00
|
|
|
extern __THREAD_INITIAL_EXEC void *__glX_tls_Context;
|
2005-04-18 17:59:53 +01:00
|
|
|
|
2009-08-12 11:41:22 +01:00
|
|
|
# define __glXGetCurrentContext() __glX_tls_Context
|
2005-04-18 17:59:53 +01:00
|
|
|
|
2008-04-18 15:28:34 +01:00
|
|
|
extern void __glXSetCurrentContextNull(void);
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
** Global lock for all threads in this address space using the GLX
|
|
|
|
** extension
|
|
|
|
*/
|
2005-04-18 17:59:53 +01:00
|
|
|
extern pthread_mutex_t __glXmutex;
|
|
|
|
#define __glXLock() pthread_mutex_lock(&__glXmutex)
|
|
|
|
#define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
** Setup for a command. Initialize the extension for dpy if necessary.
|
|
|
|
*/
|
2009-08-12 11:41:22 +01:00
|
|
|
extern CARD8 __glXSetupForCommand(Display * dpy);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Data conversion and packing support.
|
|
|
|
*/
|
|
|
|
|
2005-01-07 02:39:09 +00:00
|
|
|
extern const GLuint __glXDefaultPixelStore[9];
|
|
|
|
|
|
|
|
/* Send an image to the server using RenderLarge. */
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim,
|
2009-08-12 11:41:22 +01:00
|
|
|
GLint width, GLint height, GLint depth,
|
|
|
|
GLenum format, GLenum type,
|
|
|
|
const GLvoid * src, GLubyte * pc,
|
|
|
|
GLubyte * modes);
|
2005-01-07 02:39:09 +00:00
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/* Return the size, in bytes, of some pixel data */
|
2005-01-07 02:39:09 +00:00
|
|
|
extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/* Return the number of elements per group of a specified format*/
|
|
|
|
extern GLint __glElementsPerGroup(GLenum format, GLenum type);
|
|
|
|
|
|
|
|
/* Return the number of bytes per element, based on the element type (other
|
|
|
|
** than GL_BITMAP).
|
|
|
|
*/
|
|
|
|
extern GLint __glBytesPerElement(GLenum type);
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Fill the transport buffer with the data from the users buffer,
|
|
|
|
** applying some of the pixel store modes (unpack modes) to the data
|
|
|
|
** first. As a side effect of this call, the "modes" field is
|
|
|
|
** updated to contain the modes needed by the server to decode the
|
|
|
|
** sent data.
|
|
|
|
*/
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glFillImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum,
|
2009-08-12 11:41:22 +01:00
|
|
|
GLenum, const GLvoid *, GLubyte *, GLubyte *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/* Copy map data with a stride into a packed buffer */
|
|
|
|
extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
|
|
|
|
extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
|
|
|
|
extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
|
2009-08-12 11:41:22 +01:00
|
|
|
const GLfloat *, GLfloat *);
|
2004-10-25 22:09:16 +01:00
|
|
|
extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
|
2009-08-12 11:41:22 +01:00
|
|
|
const GLdouble *, GLdouble *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
** Empty an image out of the reply buffer into the clients memory applying
|
|
|
|
** the pack modes to pack back into the clients requested format.
|
|
|
|
*/
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glEmptyImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum,
|
2009-08-12 11:41:22 +01:00
|
|
|
GLenum, const GLubyte *, GLvoid *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2008-08-20 22:18:38 +01:00
|
|
|
** Allocate and Initialize Vertex Array client state, and free.
|
2004-10-25 22:09:16 +01:00
|
|
|
*/
|
2010-07-28 16:16:00 +01:00
|
|
|
extern void __glXInitVertexArrayState(struct glx_context *);
|
|
|
|
extern void __glXFreeVertexArrayState(struct glx_context *);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2011-11-29 01:50:07 +00:00
|
|
|
_X_HIDDEN void
|
|
|
|
__glX_send_client_info(struct glx_display *glx_dpy);
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
/************************************************************************/
|
|
|
|
|
2010-07-28 15:07:52 +01:00
|
|
|
extern void __glXInitializeVisualConfigFromTags(struct glx_config * config,
|
2009-08-12 11:41:22 +01:00
|
|
|
int count, const INT32 * bp,
|
|
|
|
Bool tagged_only,
|
|
|
|
Bool fbconfig_style_tags);
|
2004-10-25 22:09:16 +01:00
|
|
|
|
2021-04-22 23:39:41 +01:00
|
|
|
extern char *__glXQueryServerString(Display *dpy, CARD32 screen, CARD32 name);
|
|
|
|
extern char *__glXGetString(Display *dpy, CARD32 screen, CARD32 name);
|
2008-10-18 15:53:08 +01:00
|
|
|
|
2007-11-06 19:34:15 +00:00
|
|
|
extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
|
2009-08-12 11:41:22 +01:00
|
|
|
int32_t * numerator,
|
|
|
|
int32_t * denominator);
|
2006-08-29 16:38:19 +01:00
|
|
|
|
2010-04-02 09:35:19 +01:00
|
|
|
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
2010-07-21 19:09:49 +01:00
|
|
|
extern GLboolean
|
2013-12-15 10:37:55 +00:00
|
|
|
__glxGetMscRate(struct glx_screen *psc,
|
2010-07-21 19:09:49 +01:00
|
|
|
int32_t * numerator, int32_t * denominator);
|
2010-01-20 03:01:14 +00:00
|
|
|
|
|
|
|
/* So that dri2.c:DRI2WireToEvent() can access
|
|
|
|
* glx_info->codes->first_event */
|
|
|
|
XExtDisplayInfo *__glXFindDisplay (Display *dpy);
|
2010-02-15 16:12:28 +00:00
|
|
|
|
|
|
|
extern __GLXDRIdrawable *
|
2021-05-03 13:38:02 +01:00
|
|
|
GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable);
|
2011-06-05 23:50:55 +01:00
|
|
|
#endif
|
|
|
|
|
2011-11-30 18:33:37 +00:00
|
|
|
extern struct glx_screen *GetGLXScreenConfigs(Display * dpy, int scrn);
|
|
|
|
|
2011-06-05 23:50:55 +01:00
|
|
|
#ifdef GLX_USE_APPLEGL
|
|
|
|
extern struct glx_screen *
|
|
|
|
applegl_create_screen(int screen, struct glx_display * priv);
|
|
|
|
|
|
|
|
extern struct glx_context *
|
|
|
|
applegl_create_context(struct glx_screen *psc,
|
|
|
|
struct glx_config *mode,
|
|
|
|
struct glx_context *shareList, int renderType);
|
2010-02-15 16:12:28 +00:00
|
|
|
|
2011-06-05 23:50:55 +01:00
|
|
|
extern int
|
|
|
|
applegl_create_display(struct glx_display *display);
|
2021-03-18 15:36:12 +00:00
|
|
|
|
|
|
|
extern void *
|
|
|
|
applegl_get_proc_address(const char *symbol);
|
2007-11-06 19:34:15 +00:00
|
|
|
#endif
|
|
|
|
|
2013-07-18 22:19:38 +01:00
|
|
|
extern Bool validate_renderType_against_config(const struct glx_config *config,
|
|
|
|
int renderType);
|
|
|
|
|
2011-05-06 18:31:24 +01:00
|
|
|
|
2021-05-03 13:38:02 +01:00
|
|
|
extern struct glx_drawable *GetGLXDrawable(Display *dpy, GLXDrawable drawable);
|
|
|
|
extern int InitGLXDrawable(Display *dpy, struct glx_drawable *glxDraw,
|
2011-05-06 18:31:24 +01:00
|
|
|
XID xDrawable, GLXDrawable drawable);
|
2021-05-03 13:38:02 +01:00
|
|
|
extern void DestroyGLXDrawable(Display *dpy, GLXDrawable drawable);
|
2011-05-06 18:31:24 +01:00
|
|
|
|
2010-07-29 23:44:26 +01:00
|
|
|
extern struct glx_context dummyContext;
|
|
|
|
|
2010-07-28 15:28:43 +01:00
|
|
|
extern struct glx_screen *
|
2010-07-28 16:16:00 +01:00
|
|
|
indirect_create_screen(int screen, struct glx_display * priv);
|
2010-07-28 21:40:43 +01:00
|
|
|
extern struct glx_context *
|
|
|
|
indirect_create_context(struct glx_screen *psc,
|
|
|
|
struct glx_config *mode,
|
|
|
|
struct glx_context *shareList, int renderType);
|
2013-07-17 12:49:18 +01:00
|
|
|
extern struct glx_context *
|
|
|
|
indirect_create_context_attribs(struct glx_screen *base,
|
|
|
|
struct glx_config *config_base,
|
|
|
|
struct glx_context *shareList,
|
|
|
|
unsigned num_attribs,
|
|
|
|
const uint32_t *attribs,
|
|
|
|
unsigned *error);
|
2010-07-23 21:15:31 +01:00
|
|
|
|
2017-11-14 20:13:05 +00:00
|
|
|
|
2021-05-03 13:38:02 +01:00
|
|
|
extern int __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|
|
|
int attribute, unsigned int *value);
|
2017-11-14 20:13:05 +00:00
|
|
|
|
2016-04-26 19:48:12 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-10-25 22:09:16 +01:00
|
|
|
#endif /* !__GLX_client_h__ */
|