Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 1 | /* |
Adam Jackson | dc8058c | 2008-09-19 17:16:53 -0400 | [diff] [blame] | 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) |
| 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. |
| 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | * copy of this software and associated documentation files (the "Software"), |
| 7 | * to deal in the Software without restriction, including without limitation |
| 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | * and/or sell copies of the Software, and to permit persons to whom the |
| 10 | * Software is furnished to do so, subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice including the dates of first publication and |
| 13 | * either this permission notice or a reference to |
| 14 | * http://oss.sgi.com/projects/FreeB/ |
| 15 | * shall be included in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF |
| 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | * SOFTWARE. |
| 24 | * |
| 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. |
| 26 | * shall not be used in advertising or otherwise to promote the sale, use or |
| 27 | * other dealings in this Software without prior written authorization from |
| 28 | * Silicon Graphics, Inc. |
| 29 | */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * \file glxclient.h |
| 33 | * Direct rendering support added by Precision Insight, Inc. |
| 34 | * |
| 35 | * \author Kevin E. Martin <kevin@precisioninsight.com> |
| 36 | */ |
| 37 | |
| 38 | #ifndef _GLX_client_h_ |
| 39 | #define _GLX_client_h_ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 40 | #include <X11/Xproto.h> |
| 41 | #include <X11/Xlibint.h> |
Kristian Høgsberg | 38c51a7 | 2010-07-28 10:20:41 -0400 | [diff] [blame] | 42 | #include <X11/Xfuncproto.h> |
Robert Bragg | 7a9329b | 2010-01-20 03:01:14 +0000 | [diff] [blame] | 43 | #include <X11/extensions/extutil.h> |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 44 | #define GLX_GLXEXT_PROTOTYPES |
| 45 | #include <GL/glx.h> |
| 46 | #include <GL/glxext.h> |
| 47 | #include <string.h> |
| 48 | #include <stdlib.h> |
| 49 | #include <stdio.h> |
Adam Jackson | ad919c3 | 2004-11-15 15:31:32 +0000 | [diff] [blame] | 50 | #include <stdint.h> |
Emil Velikov | a385d18 | 2015-03-06 16:54:59 +0000 | [diff] [blame] | 51 | #include <pthread.h> |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 52 | #include "GL/glxproto.h" |
Kristian Høgsberg | 65d98e2 | 2010-07-28 10:13:44 -0400 | [diff] [blame] | 53 | #include "glxconfig.h" |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 54 | #include "glxhash.h" |
Brian Paul | 0339e7d | 2015-03-03 09:51:19 -0700 | [diff] [blame] | 55 | #include "util/macros.h" |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 56 | |
Jeremy Huddleston | ec77015 | 2008-08-08 02:37:14 -0700 | [diff] [blame] | 57 | #include "glxextensions.h" |
| 58 | |
Kyle Brenneman | ce562f9 | 2017-01-04 11:31:58 -0700 | [diff] [blame] | 59 | #if defined(USE_LIBGLVND) |
Kyle Brenneman | 22a9e00 | 2016-05-11 14:01:53 -0400 | [diff] [blame] | 60 | #define _GLX_PUBLIC _X_HIDDEN |
| 61 | #else |
| 62 | #define _GLX_PUBLIC _X_EXPORT |
| 63 | #endif |
Brian Paul | a25e1aa | 2008-09-18 13:26:30 -0600 | [diff] [blame] | 64 | |
Jose Fonseca | 52c7443 | 2016-04-26 19:48:12 +0100 | [diff] [blame] | 65 | #ifdef __cplusplus |
| 66 | extern "C" { |
| 67 | #endif |
| 68 | |
| 69 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 70 | #define GLX_MAJOR_VERSION 1 /* current version numbers */ |
| 71 | #define GLX_MINOR_VERSION 4 |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 72 | |
| 73 | #define __GLX_MAX_TEXTURE_UNITS 32 |
| 74 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 75 | struct glx_display; |
| 76 | struct glx_context; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 77 | |
| 78 | /************************************************************************/ |
| 79 | |
| 80 | #ifdef GLX_DIRECT_RENDERING |
| 81 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 82 | extern void DRI_glXUseXFont(struct glx_context *ctx, |
Kristian Høgsberg | 7b7845a | 2010-07-22 22:24:00 -0400 | [diff] [blame] | 83 | Font font, int first, int count, int listbase); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 84 | |
Jeremy Huddleston | 80b280d | 2010-04-02 01:35:19 -0700 | [diff] [blame] | 85 | #endif |
| 86 | |
| 87 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
| 88 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 89 | /** |
| 90 | * Display dependent methods. This structure is initialized during the |
| 91 | * \c driCreateDisplay call. |
| 92 | */ |
Kristian Høgsberg | 425f9ed | 2008-03-08 19:02:10 -0500 | [diff] [blame] | 93 | typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; |
Kristian Høgsberg | 92d2a78 | 2008-03-08 20:34:24 -0500 | [diff] [blame] | 94 | typedef struct __GLXDRIscreenRec __GLXDRIscreen; |
Kristian Høgsberg | 20b9230 | 2008-03-08 21:02:23 -0500 | [diff] [blame] | 95 | typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; |
Kristian Høgsberg | 92d2a78 | 2008-03-08 20:34:24 -0500 | [diff] [blame] | 96 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 97 | struct __GLXDRIdisplayRec |
| 98 | { |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 99 | /** |
| 100 | * Method to destroy the private DRI display data. |
| 101 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 102 | void (*destroyDisplay) (__GLXDRIdisplay * display); |
Kristian Høgsberg | a1ea6f6 | 2008-03-08 19:15:50 -0500 | [diff] [blame] | 103 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 104 | struct glx_screen *(*createScreen)(int screen, struct glx_display * priv); |
Kristian Høgsberg | 92d2a78 | 2008-03-08 20:34:24 -0500 | [diff] [blame] | 105 | }; |
| 106 | |
Jesse Barnes | daf7fe6 | 2009-09-15 23:23:09 -0700 | [diff] [blame] | 107 | struct __GLXDRIscreenRec { |
Kristian Høgsberg | 92d2a78 | 2008-03-08 20:34:24 -0500 | [diff] [blame] | 108 | |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 109 | void (*destroyScreen)(struct glx_screen *psc); |
Kristian Høgsberg | 92d2a78 | 2008-03-08 20:34:24 -0500 | [diff] [blame] | 110 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 111 | struct glx_context *(*createContext)(struct glx_screen *psc, |
| 112 | struct glx_config *config, |
| 113 | struct glx_context *shareList, |
| 114 | int renderType); |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 115 | |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 116 | __GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc, |
Jesse Barnes | daf7fe6 | 2009-09-15 23:23:09 -0700 | [diff] [blame] | 117 | XID drawable, |
| 118 | GLXDrawable glxDrawable, |
Kristian Høgsberg | 6ddf66e | 2010-07-28 10:07:52 -0400 | [diff] [blame] | 119 | struct glx_config *config); |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 120 | |
Jesse Barnes | daf7fe6 | 2009-09-15 23:23:09 -0700 | [diff] [blame] | 121 | int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc, |
Marek Olšák | 5b7e9b7 | 2012-11-13 17:06:37 +0100 | [diff] [blame] | 122 | int64_t divisor, int64_t remainder, Bool flush); |
Jesse Barnes | daf7fe6 | 2009-09-15 23:23:09 -0700 | [diff] [blame] | 123 | void (*copySubBuffer)(__GLXDRIdrawable *pdraw, |
Marek Olšák | 5b7e9b7 | 2012-11-13 17:06:37 +0100 | [diff] [blame] | 124 | int x, int y, int width, int height, Bool flush); |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 125 | int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw, |
Jesse Barnes | daf7fe6 | 2009-09-15 23:23:09 -0700 | [diff] [blame] | 126 | int64_t *ust, int64_t *msc, int64_t *sbc); |
| 127 | int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc, |
| 128 | int64_t divisor, int64_t remainder, int64_t *ust, |
| 129 | int64_t *msc, int64_t *sbc); |
| 130 | int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, |
| 131 | int64_t *msc, int64_t *sbc); |
Kristian Høgsberg | 089fc37 | 2010-07-19 16:39:53 -0400 | [diff] [blame] | 132 | int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval); |
Jesse Barnes | efc82e7 | 2009-11-10 13:28:01 -0800 | [diff] [blame] | 133 | int (*getSwapInterval)(__GLXDRIdrawable *pdraw); |
Adel Gadllah | a69fabc | 2014-02-24 20:44:42 +0100 | [diff] [blame] | 134 | int (*getBufferAge)(__GLXDRIdrawable *pdraw); |
Kristian Høgsberg | 20b9230 | 2008-03-08 21:02:23 -0500 | [diff] [blame] | 135 | }; |
| 136 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 137 | struct __GLXDRIdrawableRec |
| 138 | { |
| 139 | void (*destroyDrawable) (__GLXDRIdrawable * drawable); |
Kristian Høgsberg | 9110425 | 2008-03-12 02:18:12 -0400 | [diff] [blame] | 140 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 141 | XID xDrawable; |
| 142 | XID drawable; |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 143 | struct glx_screen *psc; |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 144 | GLenum textureTarget; |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 145 | GLenum textureFormat; /* EXT_texture_from_pixmap support */ |
Nick Bowler | f8d81c3 | 2010-07-14 12:01:49 -0400 | [diff] [blame] | 146 | unsigned long eventMask; |
Stéphane Marchesin | bf69ce3 | 2011-06-15 15:09:12 -0700 | [diff] [blame] | 147 | int refcount; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 148 | }; |
| 149 | |
| 150 | /* |
| 151 | ** Function to create and DRI display data and initialize the display |
| 152 | ** dependent methods. |
| 153 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 154 | extern __GLXDRIdisplay *driswCreateDisplay(Display * dpy); |
| 155 | extern __GLXDRIdisplay *driCreateDisplay(Display * dpy); |
| 156 | extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy); |
Jon Turney | 533b353 | 2016-07-11 21:38:16 +0100 | [diff] [blame] | 157 | extern __GLXDRIdisplay *dri3_create_display(Display * dpy); |
| 158 | extern __GLXDRIdisplay *driwindowsCreateDisplay(Display * dpy); |
| 159 | |
| 160 | /* |
| 161 | ** |
| 162 | */ |
Francisco Jerez | 61d26bc | 2010-02-08 19:27:56 +0100 | [diff] [blame] | 163 | extern void dri2InvalidateBuffers(Display *dpy, XID drawable); |
Luca Barbieri | a0e5103 | 2010-09-22 07:44:59 +0200 | [diff] [blame] | 164 | extern unsigned dri2GetSwapEventType(Display *dpy, XID drawable); |
Francisco Jerez | 61d26bc | 2010-02-08 19:27:56 +0100 | [diff] [blame] | 165 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 166 | /* |
| 167 | ** Functions to obtain driver configuration information from a direct |
| 168 | ** rendering client application |
| 169 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 170 | extern const char *glXGetScreenDriver(Display * dpy, int scrNum); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 171 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 172 | extern const char *glXGetDriverConfig(const char *driverName); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 173 | |
| 174 | #endif |
| 175 | |
| 176 | /************************************************************************/ |
| 177 | |
| 178 | #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 |
| 179 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 180 | typedef struct __GLXpixelStoreModeRec |
| 181 | { |
| 182 | GLboolean swapEndian; |
| 183 | GLboolean lsbFirst; |
| 184 | GLuint rowLength; |
| 185 | GLuint imageHeight; |
| 186 | GLuint imageDepth; |
| 187 | GLuint skipRows; |
| 188 | GLuint skipPixels; |
| 189 | GLuint skipImages; |
| 190 | GLuint alignment; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 191 | } __GLXpixelStoreMode; |
| 192 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 193 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 194 | typedef struct __GLXattributeRec |
| 195 | { |
| 196 | GLuint mask; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 197 | |
Ian Romanick | fdb0763 | 2005-02-22 22:36:31 +0000 | [diff] [blame] | 198 | /** |
| 199 | * Pixel storage state. Most of the pixel store mode state is kept |
| 200 | * here and used by the client code to manage the packing and |
| 201 | * unpacking of data sent to/received from the server. |
| 202 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 203 | __GLXpixelStoreMode storePack, storeUnpack; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 204 | |
Ian Romanick | fdb0763 | 2005-02-22 22:36:31 +0000 | [diff] [blame] | 205 | /** |
| 206 | * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically |
| 207 | * disabled? |
| 208 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 209 | GLboolean NoDrawArraysProtocol; |
| 210 | |
Ian Romanick | fdb0763 | 2005-02-22 22:36:31 +0000 | [diff] [blame] | 211 | /** |
| 212 | * Vertex Array storage state. The vertex array component |
| 213 | * state is stored here and is used to manage the packing of |
| 214 | * DrawArrays data sent to the server. |
| 215 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 216 | struct array_state_vector *array_state; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 217 | } __GLXattribute; |
| 218 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 219 | typedef struct __GLXattributeMachineRec |
| 220 | { |
| 221 | __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; |
| 222 | __GLXattribute **stackPointer; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 223 | } __GLXattributeMachine; |
| 224 | |
Emil Velikov | 13faddb | 2016-05-30 10:56:33 +0100 | [diff] [blame] | 225 | struct mesa_glinterop_device_info; |
| 226 | struct mesa_glinterop_export_in; |
| 227 | struct mesa_glinterop_export_out; |
Marek Olšák | 37d3a26 | 2016-03-03 18:43:53 +0100 | [diff] [blame] | 228 | |
Kristian Høgsberg | 643b2af | 2010-05-21 10:36:56 -0400 | [diff] [blame] | 229 | struct glx_context_vtable { |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 230 | void (*destroy)(struct glx_context *ctx); |
Kristian Høgsberg | c491e58 | 2010-07-28 15:33:09 -0400 | [diff] [blame] | 231 | int (*bind)(struct glx_context *context, struct glx_context *old, |
| 232 | GLXDrawable draw, GLXDrawable read); |
Ian Romanick | 8a4b36d | 2011-11-28 17:47:59 -0800 | [diff] [blame] | 233 | void (*unbind)(struct glx_context *context, struct glx_context *new_ctx); |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 234 | void (*wait_gl)(struct glx_context *ctx); |
| 235 | void (*wait_x)(struct glx_context *ctx); |
| 236 | void (*use_x_font)(struct glx_context *ctx, |
Kristian Høgsberg | 7b7845a | 2010-07-22 22:24:00 -0400 | [diff] [blame] | 237 | Font font, int first, int count, int listBase); |
Kristian Høgsberg | 643b2af | 2010-05-21 10:36:56 -0400 | [diff] [blame] | 238 | void (*bind_tex_image)(Display * dpy, |
| 239 | GLXDrawable drawable, |
| 240 | int buffer, const int *attrib_list); |
| 241 | void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer); |
Jeremy Huddleston | 559e4f8 | 2011-06-15 00:27:55 -0700 | [diff] [blame] | 242 | void * (*get_proc_address)(const char *symbol); |
Marek Olšák | 37d3a26 | 2016-03-03 18:43:53 +0100 | [diff] [blame] | 243 | int (*interop_query_device_info)(struct glx_context *ctx, |
Emil Velikov | 13faddb | 2016-05-30 10:56:33 +0100 | [diff] [blame] | 244 | struct mesa_glinterop_device_info *out); |
Marek Olšák | 37d3a26 | 2016-03-03 18:43:53 +0100 | [diff] [blame] | 245 | int (*interop_export_object)(struct glx_context *ctx, |
Emil Velikov | 13faddb | 2016-05-30 10:56:33 +0100 | [diff] [blame] | 246 | struct mesa_glinterop_export_in *in, |
| 247 | struct mesa_glinterop_export_out *out); |
Kristian Høgsberg | 643b2af | 2010-05-21 10:36:56 -0400 | [diff] [blame] | 248 | }; |
| 249 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 250 | /** |
| 251 | * GLX state that needs to be kept on the client. One of these records |
| 252 | * exist for each context that has been made current by this client. |
| 253 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 254 | struct glx_context |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 255 | { |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 256 | /** |
| 257 | * \name Drawing command buffer. |
| 258 | * |
| 259 | * Drawing commands are packed into this buffer before being sent as a |
| 260 | * single GLX protocol request. The buffer is sent when it overflows or |
| 261 | * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location |
| 262 | * in the buffer to be filled. \c limit is described above in the buffer |
| 263 | * slop discussion. |
| 264 | * |
| 265 | * Commands that require large amounts of data to be transfered will |
| 266 | * also use this buffer to hold a header that describes the large |
| 267 | * command. |
| 268 | * |
| 269 | * These must be the first 6 fields since they are static initialized |
| 270 | * in the dummy context in glxext.c |
| 271 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 272 | /*@{ */ |
| 273 | GLubyte *buf; |
| 274 | GLubyte *pc; |
| 275 | GLubyte *limit; |
| 276 | GLubyte *bufEnd; |
| 277 | GLint bufSize; |
| 278 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 279 | |
Kristian Høgsberg | 3ea3f5e | 2010-09-07 14:32:28 -0400 | [diff] [blame] | 280 | const struct glx_context_vtable *vtable; |
| 281 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 282 | /** |
| 283 | * The XID of this rendering context. When the context is created a |
| 284 | * new XID is allocated. This is set to None when the context is |
| 285 | * destroyed but is still current to some thread. In this case the |
| 286 | * context will be freed on next MakeCurrent. |
| 287 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 288 | XID xid; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 289 | |
| 290 | /** |
| 291 | * The XID of the \c shareList context. |
| 292 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 293 | XID share_xid; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 294 | |
| 295 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 296 | * Screen number. |
| 297 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 298 | GLint screen; |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 299 | struct glx_screen *psc; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 300 | |
| 301 | /** |
| 302 | * \c GL_TRUE if the context was created with ImportContext, which |
| 303 | * means the server-side context was created by another X client. |
| 304 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 305 | GLboolean imported; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 306 | |
| 307 | /** |
| 308 | * The context tag returned by MakeCurrent when this context is made |
| 309 | * current. This tag is used to identify the context that a thread has |
| 310 | * current so that proper server context management can be done. It is |
| 311 | * used for all context specific commands (i.e., \c Render, \c RenderLarge, |
| 312 | * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old |
| 313 | * context)). |
| 314 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 315 | GLXContextTag currentContextTag; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * \name Rendering mode |
| 319 | * |
| 320 | * The rendering mode is kept on the client as well as the server. |
| 321 | * When \c glRenderMode is called, the buffer associated with the |
| 322 | * previous rendering mode (feedback or select) is filled. |
| 323 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 324 | /*@{ */ |
| 325 | GLenum renderMode; |
| 326 | GLfloat *feedbackBuf; |
| 327 | GLuint *selectBuf; |
| 328 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 329 | |
| 330 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 331 | * Fill newImage with the unpacked form of \c oldImage getting it |
| 332 | * ready for transport to the server. |
| 333 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 334 | void (*fillImage) (struct glx_context *, GLint, GLint, GLint, GLint, GLenum, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 335 | GLenum, const GLvoid *, GLubyte *, GLubyte *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 336 | |
| 337 | /** |
Ian Romanick | 29206ae | 2005-07-29 17:30:18 +0000 | [diff] [blame] | 338 | * Client side attribs. |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 339 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 340 | __GLXattributeMachine attributes; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 341 | |
| 342 | /** |
| 343 | * Client side error code. This is set when client side gl API |
| 344 | * routines need to set an error because of a bad enumerant or |
| 345 | * running out of memory, etc. |
| 346 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 347 | GLenum error; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 348 | |
| 349 | /** |
Xiang, Haihao | ae2c31e | 2008-03-18 15:02:57 +0800 | [diff] [blame] | 350 | * Whether this context does direct rendering. |
| 351 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 352 | Bool isDirect; |
Xiang, Haihao | ae2c31e | 2008-03-18 15:02:57 +0800 | [diff] [blame] | 353 | |
Jeremy Huddleston | 488d6c7 | 2011-06-05 18:02:44 -0400 | [diff] [blame] | 354 | #if defined(GLX_DIRECT_RENDERING) && defined(GLX_USE_APPLEGL) |
| 355 | void *driContext; |
Jeremy Huddleston | 488d6c7 | 2011-06-05 18:02:44 -0400 | [diff] [blame] | 356 | #endif |
| 357 | |
Xiang, Haihao | ae2c31e | 2008-03-18 15:02:57 +0800 | [diff] [blame] | 358 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 359 | * \c dpy of current display for this context. Will be \c NULL if not |
| 360 | * current to any display, or if this is the "dummy context". |
| 361 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 362 | Display *currentDpy; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 363 | |
| 364 | /** |
| 365 | * The current drawable for this context. Will be None if this |
| 366 | * context is not current to any drawable. currentReadable is below. |
| 367 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 368 | GLXDrawable currentDrawable; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 369 | |
| 370 | /** |
| 371 | * \name GL Constant Strings |
| 372 | * |
| 373 | * Constant strings that describe the server implementation |
| 374 | * These pertain to GL attributes, not to be confused with |
| 375 | * GLX versioning attributes. |
| 376 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 377 | /*@{ */ |
| 378 | GLubyte *vendor; |
| 379 | GLubyte *renderer; |
| 380 | GLubyte *version; |
| 381 | GLubyte *extensions; |
| 382 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 383 | |
| 384 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 385 | * Maximum small render command size. This is the smaller of 64k and |
| 386 | * the size of the above buffer. |
| 387 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 388 | GLint maxSmallRenderCommandSize; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 389 | |
| 390 | /** |
| 391 | * Major opcode for the extension. Copied here so a lookup isn't |
| 392 | * needed. |
| 393 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 394 | GLint majorOpcode; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 395 | |
Kristian Høgsberg | 286ce27 | 2007-11-06 14:34:15 -0500 | [diff] [blame] | 396 | /** |
Kristian Høgsberg | 6ddf66e | 2010-07-28 10:07:52 -0400 | [diff] [blame] | 397 | * Pointer to the config used to create this context. |
Kristian Høgsberg | 286ce27 | 2007-11-06 14:34:15 -0500 | [diff] [blame] | 398 | */ |
Kristian Høgsberg | 6ddf66e | 2010-07-28 10:07:52 -0400 | [diff] [blame] | 399 | struct glx_config *config; |
Kristian Høgsberg | 286ce27 | 2007-11-06 14:34:15 -0500 | [diff] [blame] | 400 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 401 | /** |
| 402 | * The current read-drawable for this context. Will be None if this |
| 403 | * context is not current to any drawable. |
| 404 | * |
| 405 | * \since Internal API version 20030606. |
| 406 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 407 | GLXDrawable currentReadable; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 408 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 409 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 410 | * Pointer to client-state data that is private to libGL. This is only |
| 411 | * used for indirect rendering contexts. |
| 412 | * |
| 413 | * No internal API version change was made for this change. Client-side |
| 414 | * drivers should NEVER use this data or even care that it exists. |
| 415 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 416 | void *client_state_private; |
Ian Romanick | fdb0763 | 2005-02-22 22:36:31 +0000 | [diff] [blame] | 417 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 418 | /** |
| 419 | * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE. |
| 420 | */ |
| 421 | int renderType; |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 422 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 423 | /** |
| 424 | * \name Raw server GL version |
| 425 | * |
| 426 | * True core GL version supported by the server. This is the raw value |
| 427 | * returned by the server, and it may not reflect what is actually |
| 428 | * supported (or reported) by the client-side library. |
| 429 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 430 | /*@{ */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 431 | int server_major; /**< Major version number. */ |
| 432 | int server_minor; /**< Minor version number. */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 433 | /*@} */ |
Ian Romanick | fdb0763 | 2005-02-22 22:36:31 +0000 | [diff] [blame] | 434 | |
Thomas Hellstrom | 96fd3df | 2009-04-02 11:00:41 +0200 | [diff] [blame] | 435 | /** |
Eric Anholt | 49d7e48 | 2011-02-03 17:26:02 -0800 | [diff] [blame] | 436 | * Number of threads we're currently current in. |
Thomas Hellstrom | 96fd3df | 2009-04-02 11:00:41 +0200 | [diff] [blame] | 437 | */ |
Eric Anholt | 49d7e48 | 2011-02-03 17:26:02 -0800 | [diff] [blame] | 438 | unsigned long thread_refcount; |
Thomas Hellstrom | 96fd3df | 2009-04-02 11:00:41 +0200 | [diff] [blame] | 439 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 440 | char gl_extension_bits[__GL_EXT_BYTES]; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 441 | }; |
| 442 | |
Kristian Høgsberg | 3181983 | 2010-07-22 21:24:14 -0400 | [diff] [blame] | 443 | extern Bool |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 444 | glx_context_init(struct glx_context *gc, |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 445 | struct glx_screen *psc, struct glx_config *fbconfig); |
Kristian Høgsberg | 3181983 | 2010-07-22 21:24:14 -0400 | [diff] [blame] | 446 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 447 | #define __glXSetError(gc,code) \ |
| 448 | if (!(gc)->error) { \ |
| 449 | (gc)->error = code; \ |
| 450 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 451 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 452 | extern void __glFreeAttributeState(struct glx_context *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 453 | |
| 454 | /************************************************************************/ |
| 455 | |
| 456 | /** |
| 457 | * The size of the largest drawing command known to the implementation |
| 458 | * that will use the GLXRender GLX command. In this case it is |
| 459 | * \c glPolygonStipple. |
| 460 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 461 | #define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156 |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 462 | |
| 463 | /** |
| 464 | * To keep the implementation fast, the code uses a "limit" pointer |
| 465 | * to determine when the drawing command buffer is too full to hold |
| 466 | * another fixed size command. This constant defines the amount of |
| 467 | * space that must always be available in the drawing command buffer |
| 468 | * at all times for the implementation to work. It is important that |
| 469 | * the number be just large enough, but not so large as to reduce the |
| 470 | * efficacy of the buffer. The "+32" is just to keep the code working |
| 471 | * in case somebody counts wrong. |
| 472 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 473 | #define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 474 | |
| 475 | /** |
| 476 | * This implementation uses a smaller threshold for switching |
| 477 | * to the RenderLarge protocol than the protcol requires so that |
| 478 | * large copies don't occur. |
| 479 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 480 | #define __GLX_RENDER_CMD_SIZE_LIMIT 4096 |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 481 | |
| 482 | /** |
| 483 | * One of these records exists per screen of the display. It contains |
| 484 | * a pointer to the config data for that screen (if the screen supports GL). |
| 485 | */ |
Kristian Høgsberg | 6ec39db | 2010-07-23 16:15:31 -0400 | [diff] [blame] | 486 | struct glx_screen_vtable { |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 487 | struct glx_context *(*create_context)(struct glx_screen *psc, |
| 488 | struct glx_config *config, |
| 489 | struct glx_context *shareList, |
| 490 | int renderType); |
Ian Romanick | 43409fa | 2011-11-30 13:06:59 -0800 | [diff] [blame] | 491 | |
| 492 | struct glx_context *(*create_context_attribs)(struct glx_screen *psc, |
| 493 | struct glx_config *config, |
| 494 | struct glx_context *shareList, |
| 495 | unsigned num_attrib, |
| 496 | const uint32_t *attribs, |
| 497 | unsigned *error); |
Ian Romanick | 6c28c03 | 2013-02-15 22:35:24 -0800 | [diff] [blame] | 498 | int (*query_renderer_integer)(struct glx_screen *psc, |
| 499 | int attribute, |
Brian Paul | 75982a5 | 2013-11-08 09:00:46 -0700 | [diff] [blame] | 500 | unsigned int *value); |
Ian Romanick | 6c28c03 | 2013-02-15 22:35:24 -0800 | [diff] [blame] | 501 | int (*query_renderer_string)(struct glx_screen *psc, |
| 502 | int attribute, |
| 503 | const char **value); |
Kristian Høgsberg | 6ec39db | 2010-07-23 16:15:31 -0400 | [diff] [blame] | 504 | }; |
| 505 | |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 506 | struct glx_screen |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 507 | { |
Kristian Høgsberg | 6ec39db | 2010-07-23 16:15:31 -0400 | [diff] [blame] | 508 | const struct glx_screen_vtable *vtable; |
| 509 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 510 | /** |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 511 | * GLX extension string reported by the X-server. |
| 512 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 513 | const char *serverGLXexts; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 514 | |
| 515 | /** |
| 516 | * GLX extension string to be reported to applications. This is the |
| 517 | * set of extensions that the application can actually use. |
| 518 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 519 | char *effectiveGLXexts; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 520 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 521 | struct glx_display *display; |
Kristian Høgsberg | 0377551 | 2010-07-19 21:00:09 -0400 | [diff] [blame] | 522 | |
Kristian Høgsberg | 60fce15 | 2010-09-07 12:40:37 -0400 | [diff] [blame] | 523 | Display *dpy; |
| 524 | int scr; |
| 525 | |
Jeremy Huddleston | 80b280d | 2010-04-02 01:35:19 -0700 | [diff] [blame] | 526 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 527 | /** |
| 528 | * Per screen direct rendering interface functions and data. |
| 529 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 530 | __GLXDRIscreen *driScreen; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 531 | #endif |
| 532 | |
| 533 | /** |
Kristian Høgsberg | 6c533ea | 2007-10-16 16:07:47 -0400 | [diff] [blame] | 534 | * Linked list of glx visuals and fbconfigs for this screen. |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 535 | */ |
Kristian Høgsberg | 6ddf66e | 2010-07-28 10:07:52 -0400 | [diff] [blame] | 536 | struct glx_config *visuals, *configs; |
Ian Romanick | c39bf5e | 2005-07-24 06:29:14 +0000 | [diff] [blame] | 537 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 538 | /** |
| 539 | * Per-screen dynamic GLX extension tracking. The \c direct_support |
| 540 | * field only contains enough bits for 64 extensions. Should libGL |
| 541 | * ever need to track more than 64 GLX extensions, we can safely grow |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 542 | * this field. The \c struct glx_screen structure is not used outside |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 543 | * libGL. |
| 544 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 545 | /*@{ */ |
| 546 | unsigned char direct_support[8]; |
| 547 | GLboolean ext_list_first_time; |
| 548 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 549 | |
Kristian Høgsberg | aceccda | 2007-05-10 15:52:22 -0400 | [diff] [blame] | 550 | }; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 551 | |
| 552 | /** |
| 553 | * Per display private data. One of these records exists for each display |
| 554 | * that is using the OpenGL (GLX) extension. |
| 555 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 556 | struct glx_display |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 557 | { |
Kristian Høgsberg | ab434f6 | 2010-07-22 21:11:02 -0400 | [diff] [blame] | 558 | /* The extension protocol codes */ |
| 559 | XExtCodes *codes; |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 560 | struct glx_display *next; |
Kristian Høgsberg | ab434f6 | 2010-07-22 21:11:02 -0400 | [diff] [blame] | 561 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 562 | /** |
| 563 | * Back pointer to the display |
| 564 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 565 | Display *dpy; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 566 | |
| 567 | /** |
| 568 | * The \c majorOpcode is common to all connections to the same server. |
| 569 | * It is also copied into the context structure. |
| 570 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 571 | int majorOpcode; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 572 | |
| 573 | /** |
| 574 | * \name Server Version |
| 575 | * |
| 576 | * Major and minor version returned by the server during initialization. |
| 577 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 578 | /*@{ */ |
| 579 | int majorVersion, minorVersion; |
| 580 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 581 | |
| 582 | /** |
| 583 | * \name Storage for the servers GLX vendor and versions strings. |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 584 | * |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 585 | * These are the same for all screens on this display. These fields will |
| 586 | * be filled in on demand. |
| 587 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 588 | /*@{ */ |
| 589 | const char *serverGLXvendor; |
| 590 | const char *serverGLXversion; |
| 591 | /*@} */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 592 | |
| 593 | /** |
| 594 | * Configurations of visuals for all screens on this display. |
| 595 | * Also, per screen data which now includes the server \c GLX_EXTENSION |
| 596 | * string. |
| 597 | */ |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 598 | struct glx_screen **screens; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 599 | |
Jesse Barnes | 4df1376 | 2011-05-06 10:31:24 -0700 | [diff] [blame] | 600 | __glxHashTable *glXDrawHash; |
| 601 | |
Jeremy Huddleston | 80b280d | 2010-04-02 01:35:19 -0700 | [diff] [blame] | 602 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
Kristian Høgsberg | e3e8196 | 2010-07-19 21:15:50 -0400 | [diff] [blame] | 603 | __glxHashTable *drawHash; |
| 604 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 605 | /** |
| 606 | * Per display direct rendering interface functions and data. |
| 607 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 608 | __GLXDRIdisplay *driswDisplay; |
| 609 | __GLXDRIdisplay *driDisplay; |
| 610 | __GLXDRIdisplay *dri2Display; |
Keith Packard | 2d94601 | 2013-11-04 18:15:51 -0800 | [diff] [blame] | 611 | __GLXDRIdisplay *dri3Display; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 612 | #endif |
Jon Turney | 533b353 | 2016-07-11 21:38:16 +0100 | [diff] [blame] | 613 | #ifdef GLX_USE_WINDOWSGL |
| 614 | __GLXDRIdisplay *windowsdriDisplay; |
| 615 | #endif |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 616 | }; |
| 617 | |
Jesse Barnes | 4df1376 | 2011-05-06 10:31:24 -0700 | [diff] [blame] | 618 | struct glx_drawable { |
| 619 | XID xDrawable; |
| 620 | XID drawable; |
| 621 | |
| 622 | uint32_t lastEventSbc; |
| 623 | int64_t eventSbcWrap; |
| 624 | }; |
| 625 | |
Kristian Høgsberg | f972115 | 2010-07-19 14:57:59 -0400 | [diff] [blame] | 626 | extern int |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 627 | glx_screen_init(struct glx_screen *psc, |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 628 | int screen, struct glx_display * priv); |
Henri Verbeet | bfc8895 | 2011-01-29 15:00:48 -0800 | [diff] [blame] | 629 | extern void |
| 630 | glx_screen_cleanup(struct glx_screen *psc); |
Kristian Høgsberg | f972115 | 2010-07-19 14:57:59 -0400 | [diff] [blame] | 631 | |
Kristian Høgsberg | c1cbdbf | 2010-07-20 07:43:50 -0400 | [diff] [blame] | 632 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
Kristian Høgsberg | 3750ebd | 2010-07-19 09:37:07 -0400 | [diff] [blame] | 633 | extern __GLXDRIdrawable * |
| 634 | dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id); |
Kristian Høgsberg | c1cbdbf | 2010-07-20 07:43:50 -0400 | [diff] [blame] | 635 | #endif |
Kristian Høgsberg | aceccda | 2007-05-10 15:52:22 -0400 | [diff] [blame] | 636 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 637 | extern GLubyte *__glXFlushRenderBuffer(struct glx_context *, GLubyte *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 638 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 639 | extern void __glXSendLargeChunk(struct glx_context * gc, GLint requestNumber, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 640 | GLint totalRequests, |
| 641 | const GLvoid * data, GLint dataLen); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 642 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 643 | extern void __glXSendLargeCommand(struct glx_context *, const GLvoid *, GLint, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 644 | const GLvoid *, GLint); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 645 | |
| 646 | /* Initialize the GLX extension for dpy */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 647 | extern struct glx_display *__glXInitialize(Display *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 648 | |
| 649 | /************************************************************************/ |
| 650 | |
| 651 | extern int __glXDebug; |
| 652 | |
| 653 | /* This is per-thread storage in an MT environment */ |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 654 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 655 | extern void __glXSetCurrentContext(struct glx_context * c); |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 656 | |
| 657 | # if defined( GLX_USE_TLS ) |
| 658 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 659 | extern __thread void *__glX_tls_Context |
| 660 | __attribute__ ((tls_model("initial-exec"))); |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 661 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 662 | # define __glXGetCurrentContext() __glX_tls_Context |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 663 | |
| 664 | # else |
| 665 | |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 666 | extern struct glx_context *__glXGetCurrentContext(void); |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 667 | |
| 668 | # endif /* defined( GLX_USE_TLS ) */ |
| 669 | |
George Sapountzis | df04ffb | 2008-04-18 17:28:34 +0300 | [diff] [blame] | 670 | extern void __glXSetCurrentContextNull(void); |
| 671 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 672 | |
| 673 | /* |
| 674 | ** Global lock for all threads in this address space using the GLX |
| 675 | ** extension |
| 676 | */ |
Ian Romanick | 02986cb | 2005-04-18 16:59:53 +0000 | [diff] [blame] | 677 | extern pthread_mutex_t __glXmutex; |
| 678 | #define __glXLock() pthread_mutex_lock(&__glXmutex) |
| 679 | #define __glXUnlock() pthread_mutex_unlock(&__glXmutex) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 680 | |
| 681 | /* |
| 682 | ** Setup for a command. Initialize the extension for dpy if necessary. |
| 683 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 684 | extern CARD8 __glXSetupForCommand(Display * dpy); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 685 | |
| 686 | /************************************************************************/ |
| 687 | |
| 688 | /* |
| 689 | ** Data conversion and packing support. |
| 690 | */ |
| 691 | |
Ian Romanick | 5f1f229 | 2005-01-07 02:39:09 +0000 | [diff] [blame] | 692 | extern const GLuint __glXDefaultPixelStore[9]; |
| 693 | |
| 694 | /* Send an image to the server using RenderLarge. */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 695 | extern void __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 696 | GLint width, GLint height, GLint depth, |
| 697 | GLenum format, GLenum type, |
| 698 | const GLvoid * src, GLubyte * pc, |
| 699 | GLubyte * modes); |
Ian Romanick | 5f1f229 | 2005-01-07 02:39:09 +0000 | [diff] [blame] | 700 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 701 | /* Return the size, in bytes, of some pixel data */ |
Ian Romanick | 5f1f229 | 2005-01-07 02:39:09 +0000 | [diff] [blame] | 702 | extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 703 | |
| 704 | /* Return the number of elements per group of a specified format*/ |
| 705 | extern GLint __glElementsPerGroup(GLenum format, GLenum type); |
| 706 | |
| 707 | /* Return the number of bytes per element, based on the element type (other |
| 708 | ** than GL_BITMAP). |
| 709 | */ |
| 710 | extern GLint __glBytesPerElement(GLenum type); |
| 711 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 712 | /* |
| 713 | ** Fill the transport buffer with the data from the users buffer, |
| 714 | ** applying some of the pixel store modes (unpack modes) to the data |
| 715 | ** first. As a side effect of this call, the "modes" field is |
| 716 | ** updated to contain the modes needed by the server to decode the |
| 717 | ** sent data. |
| 718 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 719 | extern void __glFillImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 720 | GLenum, const GLvoid *, GLubyte *, GLubyte *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 721 | |
| 722 | /* Copy map data with a stride into a packed buffer */ |
| 723 | extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); |
| 724 | extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); |
| 725 | extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 726 | const GLfloat *, GLfloat *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 727 | extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 728 | const GLdouble *, GLdouble *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 729 | |
| 730 | /* |
| 731 | ** Empty an image out of the reply buffer into the clients memory applying |
| 732 | ** the pack modes to pack back into the clients requested format. |
| 733 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 734 | extern void __glEmptyImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 735 | GLenum, const GLubyte *, GLvoid *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 736 | |
| 737 | |
| 738 | /* |
Kristof Ralovich | e206034 | 2008-08-20 15:18:38 -0600 | [diff] [blame] | 739 | ** Allocate and Initialize Vertex Array client state, and free. |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 740 | */ |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 741 | extern void __glXInitVertexArrayState(struct glx_context *); |
| 742 | extern void __glXFreeVertexArrayState(struct glx_context *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 743 | |
| 744 | /* |
| 745 | ** Inform the Server of the major and minor numbers and of the client |
| 746 | ** libraries extension string. |
| 747 | */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 748 | extern void __glXClientInfo(Display * dpy, int opcode); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 749 | |
Ian Romanick | 6ccda72 | 2011-11-28 17:50:07 -0800 | [diff] [blame] | 750 | _X_HIDDEN void |
| 751 | __glX_send_client_info(struct glx_display *glx_dpy); |
| 752 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 753 | /************************************************************************/ |
| 754 | |
| 755 | /* |
| 756 | ** Declarations that should be in Xlib |
| 757 | */ |
| 758 | #ifdef __GL_USE_OUR_PROTOTYPES |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 759 | extern void _XFlush(Display *); |
| 760 | extern Status _XReply(Display *, xReply *, int, Bool); |
| 761 | extern void _XRead(Display *, void *, long); |
| 762 | extern void _XSend(Display *, const void *, long); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 763 | #endif |
| 764 | |
| 765 | |
Kristian Høgsberg | 6ddf66e | 2010-07-28 10:07:52 -0400 | [diff] [blame] | 766 | extern void __glXInitializeVisualConfigFromTags(struct glx_config * config, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 767 | int count, const INT32 * bp, |
| 768 | Bool tagged_only, |
| 769 | Bool fbconfig_style_tags); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 770 | |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 771 | extern char *__glXQueryServerString(Display * dpy, int opcode, |
| 772 | CARD32 screen, CARD32 name); |
| 773 | extern char *__glXGetString(Display * dpy, int opcode, |
| 774 | CARD32 screen, CARD32 name); |
RALOVICH, Kristóf | 5444424 | 2008-10-18 16:53:08 +0200 | [diff] [blame] | 775 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 776 | extern const char __glXGLClientVersion[]; |
| 777 | extern const char __glXGLClientExtensions[]; |
| 778 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 779 | /* Get the unadjusted system time */ |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 780 | extern int __glXGetUST(int64_t * ust); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 781 | |
Kristian Høgsberg | 286ce27 | 2007-11-06 14:34:15 -0500 | [diff] [blame] | 782 | extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, |
RALOVICH, Kristóf | 0896268 | 2009-08-12 12:41:22 +0200 | [diff] [blame] | 783 | int32_t * numerator, |
| 784 | int32_t * denominator); |
Ian Romanick | fc5b57b | 2006-08-29 15:38:19 +0000 | [diff] [blame] | 785 | |
Jeremy Huddleston | 80b280d | 2010-04-02 01:35:19 -0700 | [diff] [blame] | 786 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
Kristian Høgsberg | 7a66e54 | 2010-07-21 14:09:49 -0400 | [diff] [blame] | 787 | extern GLboolean |
Lauri Kasanen | fe2079c | 2013-12-15 12:37:55 +0200 | [diff] [blame] | 788 | __glxGetMscRate(struct glx_screen *psc, |
Kristian Høgsberg | 7a66e54 | 2010-07-21 14:09:49 -0400 | [diff] [blame] | 789 | int32_t * numerator, int32_t * denominator); |
Robert Bragg | 7a9329b | 2010-01-20 03:01:14 +0000 | [diff] [blame] | 790 | |
| 791 | /* So that dri2.c:DRI2WireToEvent() can access |
| 792 | * glx_info->codes->first_event */ |
| 793 | XExtDisplayInfo *__glXFindDisplay (Display *dpy); |
Kristian Høgsberg | 97ec607 | 2010-02-15 11:12:28 -0500 | [diff] [blame] | 794 | |
Kristian Høgsberg | c796bb0 | 2010-07-22 23:45:18 -0400 | [diff] [blame] | 795 | extern void |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 796 | GarbageCollectDRIDrawables(struct glx_screen *psc); |
Kristian Høgsberg | c796bb0 | 2010-07-22 23:45:18 -0400 | [diff] [blame] | 797 | |
Kristian Høgsberg | 97ec607 | 2010-02-15 11:12:28 -0500 | [diff] [blame] | 798 | extern __GLXDRIdrawable * |
Kristian Høgsberg | eeaab20 | 2010-07-22 22:36:37 -0400 | [diff] [blame] | 799 | GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); |
Jeremy Huddleston | 1885cf2 | 2011-06-05 18:50:55 -0400 | [diff] [blame] | 800 | #endif |
Kristian Høgsberg | 97ec607 | 2010-02-15 11:12:28 -0500 | [diff] [blame] | 801 | |
Ian Romanick | 588042a | 2011-11-30 10:33:37 -0800 | [diff] [blame] | 802 | extern struct glx_screen *GetGLXScreenConfigs(Display * dpy, int scrn); |
| 803 | |
Jeremy Huddleston | 1885cf2 | 2011-06-05 18:50:55 -0400 | [diff] [blame] | 804 | #ifdef GLX_USE_APPLEGL |
| 805 | extern struct glx_screen * |
| 806 | applegl_create_screen(int screen, struct glx_display * priv); |
| 807 | |
| 808 | extern struct glx_context * |
| 809 | applegl_create_context(struct glx_screen *psc, |
| 810 | struct glx_config *mode, |
| 811 | struct glx_context *shareList, int renderType); |
| 812 | |
| 813 | extern int |
| 814 | applegl_create_display(struct glx_display *display); |
Kristian Høgsberg | 286ce27 | 2007-11-06 14:34:15 -0500 | [diff] [blame] | 815 | #endif |
| 816 | |
Tomasz Lis | 2eed9ff | 2013-07-18 14:19:38 -0700 | [diff] [blame] | 817 | extern Bool validate_renderType_against_config(const struct glx_config *config, |
| 818 | int renderType); |
| 819 | |
Jesse Barnes | 4df1376 | 2011-05-06 10:31:24 -0700 | [diff] [blame] | 820 | |
| 821 | extern struct glx_drawable *GetGLXDrawable(Display *dpy, GLXDrawable drawable); |
| 822 | extern int InitGLXDrawable(Display *dpy, struct glx_drawable *glxDraw, |
| 823 | XID xDrawable, GLXDrawable drawable); |
| 824 | extern void DestroyGLXDrawable(Display *dpy, GLXDrawable drawable); |
| 825 | |
Kristian Høgsberg | f485ee7 | 2010-07-29 18:44:26 -0400 | [diff] [blame] | 826 | extern struct glx_context dummyContext; |
| 827 | |
Kristian Høgsberg | 66fc35c | 2010-07-28 10:28:43 -0400 | [diff] [blame] | 828 | extern struct glx_screen * |
Kristian Høgsberg | c356f58 | 2010-07-28 11:16:00 -0400 | [diff] [blame] | 829 | indirect_create_screen(int screen, struct glx_display * priv); |
Kristian Høgsberg | 6849916 | 2010-07-28 16:40:43 -0400 | [diff] [blame] | 830 | extern struct glx_context * |
| 831 | indirect_create_context(struct glx_screen *psc, |
| 832 | struct glx_config *mode, |
| 833 | struct glx_context *shareList, int renderType); |
Tomasz Lis | 27c8aa5 | 2013-07-17 13:49:18 +0200 | [diff] [blame] | 834 | extern struct glx_context * |
| 835 | indirect_create_context_attribs(struct glx_screen *base, |
| 836 | struct glx_config *config_base, |
| 837 | struct glx_context *shareList, |
| 838 | unsigned num_attribs, |
| 839 | const uint32_t *attribs, |
| 840 | unsigned *error); |
Kristian Høgsberg | 6ec39db | 2010-07-23 16:15:31 -0400 | [diff] [blame] | 841 | |
Adam Jackson | a48a6b8 | 2017-11-14 15:13:05 -0500 | [diff] [blame] | 842 | |
| 843 | extern int __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable, |
| 844 | int attribute, unsigned int *value); |
| 845 | |
Jose Fonseca | 52c7443 | 2016-04-26 19:48:12 +0100 | [diff] [blame] | 846 | #ifdef __cplusplus |
| 847 | } |
| 848 | #endif |
| 849 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 850 | #endif /* !__GLX_client_h__ */ |