1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // ui/gl/generate_bindings.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
13 #include "base/trace_event/trace_event.h"
14 #include "ui/gl/gl_bindings.h"
15 #include "ui/gl/gl_context.h"
16 #include "ui/gl/gl_enums.h"
17 #include "ui/gl/gl_glx_api_implementation.h"
18 #include "ui/gl/gl_implementation.h"
19 #include "ui/gl/gl_version_info.h"
23 static bool g_debugBindingsInitialized
;
24 DriverGLX g_driver_glx
;
26 void DriverGLX::InitializeStaticBindings() {
27 fn
.glXBindTexImageEXTFn
= 0;
28 fn
.glXChooseFBConfigFn
= reinterpret_cast<glXChooseFBConfigProc
>(
29 GetGLProcAddress("glXChooseFBConfig"));
30 fn
.glXChooseVisualFn
= reinterpret_cast<glXChooseVisualProc
>(
31 GetGLProcAddress("glXChooseVisual"));
33 reinterpret_cast<glXCopyContextProc
>(GetGLProcAddress("glXCopyContext"));
34 fn
.glXCopySubBufferMESAFn
= 0;
35 fn
.glXCreateContextFn
= reinterpret_cast<glXCreateContextProc
>(
36 GetGLProcAddress("glXCreateContext"));
37 fn
.glXCreateContextAttribsARBFn
= 0;
38 fn
.glXCreateGLXPixmapFn
= reinterpret_cast<glXCreateGLXPixmapProc
>(
39 GetGLProcAddress("glXCreateGLXPixmap"));
40 fn
.glXCreateNewContextFn
= reinterpret_cast<glXCreateNewContextProc
>(
41 GetGLProcAddress("glXCreateNewContext"));
42 fn
.glXCreatePbufferFn
= reinterpret_cast<glXCreatePbufferProc
>(
43 GetGLProcAddress("glXCreatePbuffer"));
44 fn
.glXCreatePixmapFn
= reinterpret_cast<glXCreatePixmapProc
>(
45 GetGLProcAddress("glXCreatePixmap"));
46 fn
.glXCreateWindowFn
= reinterpret_cast<glXCreateWindowProc
>(
47 GetGLProcAddress("glXCreateWindow"));
48 fn
.glXDestroyContextFn
= reinterpret_cast<glXDestroyContextProc
>(
49 GetGLProcAddress("glXDestroyContext"));
50 fn
.glXDestroyGLXPixmapFn
= reinterpret_cast<glXDestroyGLXPixmapProc
>(
51 GetGLProcAddress("glXDestroyGLXPixmap"));
52 fn
.glXDestroyPbufferFn
= reinterpret_cast<glXDestroyPbufferProc
>(
53 GetGLProcAddress("glXDestroyPbuffer"));
54 fn
.glXDestroyPixmapFn
= reinterpret_cast<glXDestroyPixmapProc
>(
55 GetGLProcAddress("glXDestroyPixmap"));
56 fn
.glXDestroyWindowFn
= reinterpret_cast<glXDestroyWindowProc
>(
57 GetGLProcAddress("glXDestroyWindow"));
58 fn
.glXGetClientStringFn
= reinterpret_cast<glXGetClientStringProc
>(
59 GetGLProcAddress("glXGetClientString"));
61 reinterpret_cast<glXGetConfigProc
>(GetGLProcAddress("glXGetConfig"));
62 fn
.glXGetCurrentContextFn
= reinterpret_cast<glXGetCurrentContextProc
>(
63 GetGLProcAddress("glXGetCurrentContext"));
64 fn
.glXGetCurrentDisplayFn
= reinterpret_cast<glXGetCurrentDisplayProc
>(
65 GetGLProcAddress("glXGetCurrentDisplay"));
66 fn
.glXGetCurrentDrawableFn
= reinterpret_cast<glXGetCurrentDrawableProc
>(
67 GetGLProcAddress("glXGetCurrentDrawable"));
68 fn
.glXGetCurrentReadDrawableFn
=
69 reinterpret_cast<glXGetCurrentReadDrawableProc
>(
70 GetGLProcAddress("glXGetCurrentReadDrawable"));
71 fn
.glXGetFBConfigAttribFn
= reinterpret_cast<glXGetFBConfigAttribProc
>(
72 GetGLProcAddress("glXGetFBConfigAttrib"));
73 fn
.glXGetFBConfigFromVisualSGIXFn
= 0;
74 fn
.glXGetFBConfigsFn
= reinterpret_cast<glXGetFBConfigsProc
>(
75 GetGLProcAddress("glXGetFBConfigs"));
76 fn
.glXGetMscRateOMLFn
= 0;
77 fn
.glXGetSelectedEventFn
= reinterpret_cast<glXGetSelectedEventProc
>(
78 GetGLProcAddress("glXGetSelectedEvent"));
79 fn
.glXGetSyncValuesOMLFn
= 0;
80 fn
.glXGetVisualFromFBConfigFn
=
81 reinterpret_cast<glXGetVisualFromFBConfigProc
>(
82 GetGLProcAddress("glXGetVisualFromFBConfig"));
84 reinterpret_cast<glXIsDirectProc
>(GetGLProcAddress("glXIsDirect"));
85 fn
.glXMakeContextCurrentFn
= reinterpret_cast<glXMakeContextCurrentProc
>(
86 GetGLProcAddress("glXMakeContextCurrent"));
88 reinterpret_cast<glXMakeCurrentProc
>(GetGLProcAddress("glXMakeCurrent"));
89 fn
.glXQueryContextFn
= reinterpret_cast<glXQueryContextProc
>(
90 GetGLProcAddress("glXQueryContext"));
91 fn
.glXQueryDrawableFn
= reinterpret_cast<glXQueryDrawableProc
>(
92 GetGLProcAddress("glXQueryDrawable"));
93 fn
.glXQueryExtensionFn
= reinterpret_cast<glXQueryExtensionProc
>(
94 GetGLProcAddress("glXQueryExtension"));
95 fn
.glXQueryExtensionsStringFn
=
96 reinterpret_cast<glXQueryExtensionsStringProc
>(
97 GetGLProcAddress("glXQueryExtensionsString"));
98 fn
.glXQueryServerStringFn
= reinterpret_cast<glXQueryServerStringProc
>(
99 GetGLProcAddress("glXQueryServerString"));
100 fn
.glXQueryVersionFn
= reinterpret_cast<glXQueryVersionProc
>(
101 GetGLProcAddress("glXQueryVersion"));
102 fn
.glXReleaseTexImageEXTFn
= 0;
103 fn
.glXSelectEventFn
=
104 reinterpret_cast<glXSelectEventProc
>(GetGLProcAddress("glXSelectEvent"));
105 fn
.glXSwapBuffersFn
=
106 reinterpret_cast<glXSwapBuffersProc
>(GetGLProcAddress("glXSwapBuffers"));
107 fn
.glXSwapIntervalEXTFn
= 0;
108 fn
.glXSwapIntervalMESAFn
= 0;
110 reinterpret_cast<glXUseXFontProc
>(GetGLProcAddress("glXUseXFont"));
112 reinterpret_cast<glXWaitGLProc
>(GetGLProcAddress("glXWaitGL"));
113 fn
.glXWaitVideoSyncSGIFn
= 0;
114 fn
.glXWaitXFn
= reinterpret_cast<glXWaitXProc
>(GetGLProcAddress("glXWaitX"));
117 void DriverGLX::InitializeExtensionBindings() {
118 std::string
extensions(GetPlatformExtensions());
120 ALLOW_UNUSED_LOCAL(extensions
);
122 ext
.b_GLX_ARB_create_context
=
123 extensions
.find("GLX_ARB_create_context ") != std::string::npos
;
124 ext
.b_GLX_EXT_swap_control
=
125 extensions
.find("GLX_EXT_swap_control ") != std::string::npos
;
126 ext
.b_GLX_EXT_texture_from_pixmap
=
127 extensions
.find("GLX_EXT_texture_from_pixmap ") != std::string::npos
;
128 ext
.b_GLX_MESA_copy_sub_buffer
=
129 extensions
.find("GLX_MESA_copy_sub_buffer ") != std::string::npos
;
130 ext
.b_GLX_MESA_swap_control
=
131 extensions
.find("GLX_MESA_swap_control ") != std::string::npos
;
132 ext
.b_GLX_OML_sync_control
=
133 extensions
.find("GLX_OML_sync_control ") != std::string::npos
;
134 ext
.b_GLX_SGIX_fbconfig
=
135 extensions
.find("GLX_SGIX_fbconfig ") != std::string::npos
;
136 ext
.b_GLX_SGI_video_sync
=
137 extensions
.find("GLX_SGI_video_sync ") != std::string::npos
;
139 debug_fn
.glXBindTexImageEXTFn
= 0;
140 if (ext
.b_GLX_EXT_texture_from_pixmap
) {
141 fn
.glXBindTexImageEXTFn
= reinterpret_cast<glXBindTexImageEXTProc
>(
142 GetGLProcAddress("glXBindTexImageEXT"));
143 DCHECK(fn
.glXBindTexImageEXTFn
);
146 debug_fn
.glXCopySubBufferMESAFn
= 0;
147 if (ext
.b_GLX_MESA_copy_sub_buffer
) {
148 fn
.glXCopySubBufferMESAFn
= reinterpret_cast<glXCopySubBufferMESAProc
>(
149 GetGLProcAddress("glXCopySubBufferMESA"));
150 DCHECK(fn
.glXCopySubBufferMESAFn
);
153 debug_fn
.glXCreateContextAttribsARBFn
= 0;
154 if (ext
.b_GLX_ARB_create_context
) {
155 fn
.glXCreateContextAttribsARBFn
=
156 reinterpret_cast<glXCreateContextAttribsARBProc
>(
157 GetGLProcAddress("glXCreateContextAttribsARB"));
158 DCHECK(fn
.glXCreateContextAttribsARBFn
);
161 debug_fn
.glXGetFBConfigFromVisualSGIXFn
= 0;
162 if (ext
.b_GLX_SGIX_fbconfig
) {
163 fn
.glXGetFBConfigFromVisualSGIXFn
=
164 reinterpret_cast<glXGetFBConfigFromVisualSGIXProc
>(
165 GetGLProcAddress("glXGetFBConfigFromVisualSGIX"));
166 DCHECK(fn
.glXGetFBConfigFromVisualSGIXFn
);
169 debug_fn
.glXGetMscRateOMLFn
= 0;
170 if (ext
.b_GLX_OML_sync_control
) {
171 fn
.glXGetMscRateOMLFn
= reinterpret_cast<glXGetMscRateOMLProc
>(
172 GetGLProcAddress("glXGetMscRateOML"));
173 DCHECK(fn
.glXGetMscRateOMLFn
);
176 debug_fn
.glXGetSyncValuesOMLFn
= 0;
177 if (ext
.b_GLX_OML_sync_control
) {
178 fn
.glXGetSyncValuesOMLFn
= reinterpret_cast<glXGetSyncValuesOMLProc
>(
179 GetGLProcAddress("glXGetSyncValuesOML"));
180 DCHECK(fn
.glXGetSyncValuesOMLFn
);
183 debug_fn
.glXReleaseTexImageEXTFn
= 0;
184 if (ext
.b_GLX_EXT_texture_from_pixmap
) {
185 fn
.glXReleaseTexImageEXTFn
= reinterpret_cast<glXReleaseTexImageEXTProc
>(
186 GetGLProcAddress("glXReleaseTexImageEXT"));
187 DCHECK(fn
.glXReleaseTexImageEXTFn
);
190 debug_fn
.glXSwapIntervalEXTFn
= 0;
191 if (ext
.b_GLX_EXT_swap_control
) {
192 fn
.glXSwapIntervalEXTFn
= reinterpret_cast<glXSwapIntervalEXTProc
>(
193 GetGLProcAddress("glXSwapIntervalEXT"));
194 DCHECK(fn
.glXSwapIntervalEXTFn
);
197 debug_fn
.glXSwapIntervalMESAFn
= 0;
198 if (ext
.b_GLX_MESA_swap_control
) {
199 fn
.glXSwapIntervalMESAFn
= reinterpret_cast<glXSwapIntervalMESAProc
>(
200 GetGLProcAddress("glXSwapIntervalMESA"));
201 DCHECK(fn
.glXSwapIntervalMESAFn
);
204 debug_fn
.glXWaitVideoSyncSGIFn
= 0;
205 if (ext
.b_GLX_SGI_video_sync
) {
206 fn
.glXWaitVideoSyncSGIFn
= reinterpret_cast<glXWaitVideoSyncSGIProc
>(
207 GetGLProcAddress("glXWaitVideoSyncSGI"));
208 DCHECK(fn
.glXWaitVideoSyncSGIFn
);
211 if (g_debugBindingsInitialized
)
212 InitializeDebugBindings();
217 static void GL_BINDING_CALL
Debug_glXBindTexImageEXT(Display
* dpy
,
218 GLXDrawable drawable
,
221 GL_SERVICE_LOG("glXBindTexImageEXT"
222 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
223 << ", " << buffer
<< ", "
224 << static_cast<const void*>(attribList
) << ")");
225 g_driver_glx
.debug_fn
.glXBindTexImageEXTFn(dpy
, drawable
, buffer
, attribList
);
228 static GLXFBConfig
* GL_BINDING_CALL
229 Debug_glXChooseFBConfig(Display
* dpy
,
231 const int* attribList
,
233 GL_SERVICE_LOG("glXChooseFBConfig"
234 << "(" << static_cast<const void*>(dpy
) << ", " << screen
235 << ", " << static_cast<const void*>(attribList
) << ", "
236 << static_cast<const void*>(nitems
) << ")");
237 GLXFBConfig
* result
= g_driver_glx
.debug_fn
.glXChooseFBConfigFn(
238 dpy
, screen
, attribList
, nitems
);
239 GL_SERVICE_LOG("GL_RESULT: " << result
);
243 static XVisualInfo
* GL_BINDING_CALL
Debug_glXChooseVisual(Display
* dpy
,
246 GL_SERVICE_LOG("glXChooseVisual"
247 << "(" << static_cast<const void*>(dpy
) << ", " << screen
248 << ", " << static_cast<const void*>(attribList
) << ")");
249 XVisualInfo
* result
=
250 g_driver_glx
.debug_fn
.glXChooseVisualFn(dpy
, screen
, attribList
);
251 GL_SERVICE_LOG("GL_RESULT: " << result
);
255 static void GL_BINDING_CALL
Debug_glXCopyContext(Display
* dpy
,
258 unsigned long mask
) {
259 GL_SERVICE_LOG("glXCopyContext"
260 << "(" << static_cast<const void*>(dpy
) << ", " << src
<< ", "
261 << dst
<< ", " << mask
<< ")");
262 g_driver_glx
.debug_fn
.glXCopyContextFn(dpy
, src
, dst
, mask
);
265 static void GL_BINDING_CALL
Debug_glXCopySubBufferMESA(Display
* dpy
,
266 GLXDrawable drawable
,
271 GL_SERVICE_LOG("glXCopySubBufferMESA"
272 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
273 << ", " << x
<< ", " << y
<< ", " << width
<< ", " << height
275 g_driver_glx
.debug_fn
.glXCopySubBufferMESAFn(dpy
, drawable
, x
, y
, width
,
279 static GLXContext GL_BINDING_CALL
Debug_glXCreateContext(Display
* dpy
,
281 GLXContext shareList
,
283 GL_SERVICE_LOG("glXCreateContext"
284 << "(" << static_cast<const void*>(dpy
) << ", "
285 << static_cast<const void*>(vis
) << ", " << shareList
<< ", "
288 g_driver_glx
.debug_fn
.glXCreateContextFn(dpy
, vis
, shareList
, direct
);
289 GL_SERVICE_LOG("GL_RESULT: " << result
);
293 static GLXContext GL_BINDING_CALL
294 Debug_glXCreateContextAttribsARB(Display
* dpy
,
296 GLXContext share_context
,
298 const int* attrib_list
) {
299 GL_SERVICE_LOG("glXCreateContextAttribsARB"
300 << "(" << static_cast<const void*>(dpy
) << ", " << config
301 << ", " << share_context
<< ", " << direct
<< ", "
302 << static_cast<const void*>(attrib_list
) << ")");
303 GLXContext result
= g_driver_glx
.debug_fn
.glXCreateContextAttribsARBFn(
304 dpy
, config
, share_context
, direct
, attrib_list
);
305 GL_SERVICE_LOG("GL_RESULT: " << result
);
309 static GLXPixmap GL_BINDING_CALL
Debug_glXCreateGLXPixmap(Display
* dpy
,
312 GL_SERVICE_LOG("glXCreateGLXPixmap"
313 << "(" << static_cast<const void*>(dpy
) << ", "
314 << static_cast<const void*>(visual
) << ", " << pixmap
<< ")");
316 g_driver_glx
.debug_fn
.glXCreateGLXPixmapFn(dpy
, visual
, pixmap
);
317 GL_SERVICE_LOG("GL_RESULT: " << result
);
321 static GLXContext GL_BINDING_CALL
322 Debug_glXCreateNewContext(Display
* dpy
,
325 GLXContext shareList
,
327 GL_SERVICE_LOG("glXCreateNewContext"
328 << "(" << static_cast<const void*>(dpy
) << ", " << config
329 << ", " << renderType
<< ", " << shareList
<< ", " << direct
331 GLXContext result
= g_driver_glx
.debug_fn
.glXCreateNewContextFn(
332 dpy
, config
, renderType
, shareList
, direct
);
333 GL_SERVICE_LOG("GL_RESULT: " << result
);
337 static GLXPbuffer GL_BINDING_CALL
338 Debug_glXCreatePbuffer(Display
* dpy
,
340 const int* attribList
) {
341 GL_SERVICE_LOG("glXCreatePbuffer"
342 << "(" << static_cast<const void*>(dpy
) << ", " << config
343 << ", " << static_cast<const void*>(attribList
) << ")");
345 g_driver_glx
.debug_fn
.glXCreatePbufferFn(dpy
, config
, attribList
);
346 GL_SERVICE_LOG("GL_RESULT: " << result
);
350 static GLXPixmap GL_BINDING_CALL
Debug_glXCreatePixmap(Display
* dpy
,
353 const int* attribList
) {
354 GL_SERVICE_LOG("glXCreatePixmap"
355 << "(" << static_cast<const void*>(dpy
) << ", " << config
356 << ", " << pixmap
<< ", "
357 << static_cast<const void*>(attribList
) << ")");
359 g_driver_glx
.debug_fn
.glXCreatePixmapFn(dpy
, config
, pixmap
, attribList
);
360 GL_SERVICE_LOG("GL_RESULT: " << result
);
364 static GLXWindow GL_BINDING_CALL
Debug_glXCreateWindow(Display
* dpy
,
367 const int* attribList
) {
368 GL_SERVICE_LOG("glXCreateWindow"
369 << "(" << static_cast<const void*>(dpy
) << ", " << config
370 << ", " << win
<< ", " << static_cast<const void*>(attribList
)
373 g_driver_glx
.debug_fn
.glXCreateWindowFn(dpy
, config
, win
, attribList
);
374 GL_SERVICE_LOG("GL_RESULT: " << result
);
378 static void GL_BINDING_CALL
Debug_glXDestroyContext(Display
* dpy
,
380 GL_SERVICE_LOG("glXDestroyContext"
381 << "(" << static_cast<const void*>(dpy
) << ", " << ctx
<< ")");
382 g_driver_glx
.debug_fn
.glXDestroyContextFn(dpy
, ctx
);
385 static void GL_BINDING_CALL
Debug_glXDestroyGLXPixmap(Display
* dpy
,
387 GL_SERVICE_LOG("glXDestroyGLXPixmap"
388 << "(" << static_cast<const void*>(dpy
) << ", " << pixmap
390 g_driver_glx
.debug_fn
.glXDestroyGLXPixmapFn(dpy
, pixmap
);
393 static void GL_BINDING_CALL
Debug_glXDestroyPbuffer(Display
* dpy
,
395 GL_SERVICE_LOG("glXDestroyPbuffer"
396 << "(" << static_cast<const void*>(dpy
) << ", " << pbuf
398 g_driver_glx
.debug_fn
.glXDestroyPbufferFn(dpy
, pbuf
);
401 static void GL_BINDING_CALL
Debug_glXDestroyPixmap(Display
* dpy
,
403 GL_SERVICE_LOG("glXDestroyPixmap"
404 << "(" << static_cast<const void*>(dpy
) << ", " << pixmap
406 g_driver_glx
.debug_fn
.glXDestroyPixmapFn(dpy
, pixmap
);
409 static void GL_BINDING_CALL
Debug_glXDestroyWindow(Display
* dpy
,
411 GL_SERVICE_LOG("glXDestroyWindow"
412 << "(" << static_cast<const void*>(dpy
) << ", " << window
414 g_driver_glx
.debug_fn
.glXDestroyWindowFn(dpy
, window
);
417 static const char* GL_BINDING_CALL
Debug_glXGetClientString(Display
* dpy
,
419 GL_SERVICE_LOG("glXGetClientString"
420 << "(" << static_cast<const void*>(dpy
) << ", " << name
422 const char* result
= g_driver_glx
.debug_fn
.glXGetClientStringFn(dpy
, name
);
423 GL_SERVICE_LOG("GL_RESULT: " << result
);
427 static int GL_BINDING_CALL
Debug_glXGetConfig(Display
* dpy
,
431 GL_SERVICE_LOG("glXGetConfig"
432 << "(" << static_cast<const void*>(dpy
) << ", "
433 << static_cast<const void*>(visual
) << ", " << attrib
<< ", "
434 << static_cast<const void*>(value
) << ")");
435 int result
= g_driver_glx
.debug_fn
.glXGetConfigFn(dpy
, visual
, attrib
, value
);
436 GL_SERVICE_LOG("GL_RESULT: " << result
);
440 static GLXContext GL_BINDING_CALL
Debug_glXGetCurrentContext(void) {
441 GL_SERVICE_LOG("glXGetCurrentContext"
444 GLXContext result
= g_driver_glx
.debug_fn
.glXGetCurrentContextFn();
445 GL_SERVICE_LOG("GL_RESULT: " << result
);
449 static Display
* GL_BINDING_CALL
Debug_glXGetCurrentDisplay(void) {
450 GL_SERVICE_LOG("glXGetCurrentDisplay"
453 Display
* result
= g_driver_glx
.debug_fn
.glXGetCurrentDisplayFn();
454 GL_SERVICE_LOG("GL_RESULT: " << result
);
458 static GLXDrawable GL_BINDING_CALL
Debug_glXGetCurrentDrawable(void) {
459 GL_SERVICE_LOG("glXGetCurrentDrawable"
462 GLXDrawable result
= g_driver_glx
.debug_fn
.glXGetCurrentDrawableFn();
463 GL_SERVICE_LOG("GL_RESULT: " << result
);
467 static GLXDrawable GL_BINDING_CALL
Debug_glXGetCurrentReadDrawable(void) {
468 GL_SERVICE_LOG("glXGetCurrentReadDrawable"
471 GLXDrawable result
= g_driver_glx
.debug_fn
.glXGetCurrentReadDrawableFn();
472 GL_SERVICE_LOG("GL_RESULT: " << result
);
476 static int GL_BINDING_CALL
Debug_glXGetFBConfigAttrib(Display
* dpy
,
480 GL_SERVICE_LOG("glXGetFBConfigAttrib"
481 << "(" << static_cast<const void*>(dpy
) << ", " << config
482 << ", " << attribute
<< ", " << static_cast<const void*>(value
)
484 int result
= g_driver_glx
.debug_fn
.glXGetFBConfigAttribFn(dpy
, config
,
486 GL_SERVICE_LOG("GL_RESULT: " << result
);
490 static GLXFBConfig GL_BINDING_CALL
491 Debug_glXGetFBConfigFromVisualSGIX(Display
* dpy
, XVisualInfo
* visualInfo
) {
492 GL_SERVICE_LOG("glXGetFBConfigFromVisualSGIX"
493 << "(" << static_cast<const void*>(dpy
) << ", "
494 << static_cast<const void*>(visualInfo
) << ")");
496 g_driver_glx
.debug_fn
.glXGetFBConfigFromVisualSGIXFn(dpy
, visualInfo
);
497 GL_SERVICE_LOG("GL_RESULT: " << result
);
501 static GLXFBConfig
* GL_BINDING_CALL
Debug_glXGetFBConfigs(Display
* dpy
,
504 GL_SERVICE_LOG("glXGetFBConfigs"
505 << "(" << static_cast<const void*>(dpy
) << ", " << screen
506 << ", " << static_cast<const void*>(nelements
) << ")");
507 GLXFBConfig
* result
=
508 g_driver_glx
.debug_fn
.glXGetFBConfigsFn(dpy
, screen
, nelements
);
509 GL_SERVICE_LOG("GL_RESULT: " << result
);
513 static bool GL_BINDING_CALL
Debug_glXGetMscRateOML(Display
* dpy
,
514 GLXDrawable drawable
,
516 int32
* denominator
) {
517 GL_SERVICE_LOG("glXGetMscRateOML"
518 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
519 << ", " << static_cast<const void*>(numerator
) << ", "
520 << static_cast<const void*>(denominator
) << ")");
521 bool result
= g_driver_glx
.debug_fn
.glXGetMscRateOMLFn(
522 dpy
, drawable
, numerator
, denominator
);
523 GL_SERVICE_LOG("GL_RESULT: " << result
);
527 static void GL_BINDING_CALL
Debug_glXGetSelectedEvent(Display
* dpy
,
528 GLXDrawable drawable
,
529 unsigned long* mask
) {
530 GL_SERVICE_LOG("glXGetSelectedEvent"
531 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
532 << ", " << static_cast<const void*>(mask
) << ")");
533 g_driver_glx
.debug_fn
.glXGetSelectedEventFn(dpy
, drawable
, mask
);
536 static bool GL_BINDING_CALL
Debug_glXGetSyncValuesOML(Display
* dpy
,
537 GLXDrawable drawable
,
541 GL_SERVICE_LOG("glXGetSyncValuesOML"
542 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
543 << ", " << static_cast<const void*>(ust
) << ", "
544 << static_cast<const void*>(msc
) << ", "
545 << static_cast<const void*>(sbc
) << ")");
547 g_driver_glx
.debug_fn
.glXGetSyncValuesOMLFn(dpy
, drawable
, ust
, msc
, sbc
);
548 GL_SERVICE_LOG("GL_RESULT: " << result
);
552 static XVisualInfo
* GL_BINDING_CALL
553 Debug_glXGetVisualFromFBConfig(Display
* dpy
, GLXFBConfig config
) {
554 GL_SERVICE_LOG("glXGetVisualFromFBConfig"
555 << "(" << static_cast<const void*>(dpy
) << ", " << config
557 XVisualInfo
* result
=
558 g_driver_glx
.debug_fn
.glXGetVisualFromFBConfigFn(dpy
, config
);
559 GL_SERVICE_LOG("GL_RESULT: " << result
);
563 static int GL_BINDING_CALL
Debug_glXIsDirect(Display
* dpy
, GLXContext ctx
) {
564 GL_SERVICE_LOG("glXIsDirect"
565 << "(" << static_cast<const void*>(dpy
) << ", " << ctx
<< ")");
566 int result
= g_driver_glx
.debug_fn
.glXIsDirectFn(dpy
, ctx
);
567 GL_SERVICE_LOG("GL_RESULT: " << result
);
571 static int GL_BINDING_CALL
Debug_glXMakeContextCurrent(Display
* dpy
,
575 GL_SERVICE_LOG("glXMakeContextCurrent"
576 << "(" << static_cast<const void*>(dpy
) << ", " << draw
<< ", "
577 << read
<< ", " << ctx
<< ")");
579 g_driver_glx
.debug_fn
.glXMakeContextCurrentFn(dpy
, draw
, read
, ctx
);
580 GL_SERVICE_LOG("GL_RESULT: " << result
);
584 static int GL_BINDING_CALL
Debug_glXMakeCurrent(Display
* dpy
,
585 GLXDrawable drawable
,
587 GL_SERVICE_LOG("glXMakeCurrent"
588 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
589 << ", " << ctx
<< ")");
590 int result
= g_driver_glx
.debug_fn
.glXMakeCurrentFn(dpy
, drawable
, ctx
);
591 GL_SERVICE_LOG("GL_RESULT: " << result
);
595 static int GL_BINDING_CALL
Debug_glXQueryContext(Display
* dpy
,
599 GL_SERVICE_LOG("glXQueryContext"
600 << "(" << static_cast<const void*>(dpy
) << ", " << ctx
<< ", "
601 << attribute
<< ", " << static_cast<const void*>(value
)
604 g_driver_glx
.debug_fn
.glXQueryContextFn(dpy
, ctx
, attribute
, value
);
605 GL_SERVICE_LOG("GL_RESULT: " << result
);
609 static void GL_BINDING_CALL
Debug_glXQueryDrawable(Display
* dpy
,
612 unsigned int* value
) {
613 GL_SERVICE_LOG("glXQueryDrawable"
614 << "(" << static_cast<const void*>(dpy
) << ", " << draw
<< ", "
615 << attribute
<< ", " << static_cast<const void*>(value
)
617 g_driver_glx
.debug_fn
.glXQueryDrawableFn(dpy
, draw
, attribute
, value
);
620 static int GL_BINDING_CALL
Debug_glXQueryExtension(Display
* dpy
,
623 GL_SERVICE_LOG("glXQueryExtension"
624 << "(" << static_cast<const void*>(dpy
) << ", "
625 << static_cast<const void*>(errorb
) << ", "
626 << static_cast<const void*>(event
) << ")");
627 int result
= g_driver_glx
.debug_fn
.glXQueryExtensionFn(dpy
, errorb
, event
);
628 GL_SERVICE_LOG("GL_RESULT: " << result
);
632 static const char* GL_BINDING_CALL
Debug_glXQueryExtensionsString(Display
* dpy
,
634 GL_SERVICE_LOG("glXQueryExtensionsString"
635 << "(" << static_cast<const void*>(dpy
) << ", " << screen
638 g_driver_glx
.debug_fn
.glXQueryExtensionsStringFn(dpy
, screen
);
639 GL_SERVICE_LOG("GL_RESULT: " << result
);
643 static const char* GL_BINDING_CALL
Debug_glXQueryServerString(Display
* dpy
,
646 GL_SERVICE_LOG("glXQueryServerString"
647 << "(" << static_cast<const void*>(dpy
) << ", " << screen
648 << ", " << name
<< ")");
650 g_driver_glx
.debug_fn
.glXQueryServerStringFn(dpy
, screen
, name
);
651 GL_SERVICE_LOG("GL_RESULT: " << result
);
655 static int GL_BINDING_CALL
Debug_glXQueryVersion(Display
* dpy
,
658 GL_SERVICE_LOG("glXQueryVersion"
659 << "(" << static_cast<const void*>(dpy
) << ", "
660 << static_cast<const void*>(maj
) << ", "
661 << static_cast<const void*>(min
) << ")");
662 int result
= g_driver_glx
.debug_fn
.glXQueryVersionFn(dpy
, maj
, min
);
663 GL_SERVICE_LOG("GL_RESULT: " << result
);
667 static void GL_BINDING_CALL
Debug_glXReleaseTexImageEXT(Display
* dpy
,
668 GLXDrawable drawable
,
670 GL_SERVICE_LOG("glXReleaseTexImageEXT"
671 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
672 << ", " << buffer
<< ")");
673 g_driver_glx
.debug_fn
.glXReleaseTexImageEXTFn(dpy
, drawable
, buffer
);
676 static void GL_BINDING_CALL
Debug_glXSelectEvent(Display
* dpy
,
677 GLXDrawable drawable
,
678 unsigned long mask
) {
679 GL_SERVICE_LOG("glXSelectEvent"
680 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
681 << ", " << mask
<< ")");
682 g_driver_glx
.debug_fn
.glXSelectEventFn(dpy
, drawable
, mask
);
685 static void GL_BINDING_CALL
Debug_glXSwapBuffers(Display
* dpy
,
686 GLXDrawable drawable
) {
687 GL_SERVICE_LOG("glXSwapBuffers"
688 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
690 g_driver_glx
.debug_fn
.glXSwapBuffersFn(dpy
, drawable
);
693 static void GL_BINDING_CALL
Debug_glXSwapIntervalEXT(Display
* dpy
,
694 GLXDrawable drawable
,
696 GL_SERVICE_LOG("glXSwapIntervalEXT"
697 << "(" << static_cast<const void*>(dpy
) << ", " << drawable
698 << ", " << interval
<< ")");
699 g_driver_glx
.debug_fn
.glXSwapIntervalEXTFn(dpy
, drawable
, interval
);
702 static void GL_BINDING_CALL
Debug_glXSwapIntervalMESA(unsigned int interval
) {
703 GL_SERVICE_LOG("glXSwapIntervalMESA"
704 << "(" << interval
<< ")");
705 g_driver_glx
.debug_fn
.glXSwapIntervalMESAFn(interval
);
708 static void GL_BINDING_CALL
Debug_glXUseXFont(Font font
,
712 GL_SERVICE_LOG("glXUseXFont"
713 << "(" << font
<< ", " << first
<< ", " << count
<< ", "
715 g_driver_glx
.debug_fn
.glXUseXFontFn(font
, first
, count
, list
);
718 static void GL_BINDING_CALL
Debug_glXWaitGL(void) {
719 GL_SERVICE_LOG("glXWaitGL"
722 g_driver_glx
.debug_fn
.glXWaitGLFn();
725 static int GL_BINDING_CALL
Debug_glXWaitVideoSyncSGI(int divisor
,
727 unsigned int* count
) {
728 GL_SERVICE_LOG("glXWaitVideoSyncSGI"
729 << "(" << divisor
<< ", " << remainder
<< ", "
730 << static_cast<const void*>(count
) << ")");
732 g_driver_glx
.debug_fn
.glXWaitVideoSyncSGIFn(divisor
, remainder
, count
);
733 GL_SERVICE_LOG("GL_RESULT: " << result
);
737 static void GL_BINDING_CALL
Debug_glXWaitX(void) {
738 GL_SERVICE_LOG("glXWaitX"
741 g_driver_glx
.debug_fn
.glXWaitXFn();
745 void DriverGLX::InitializeDebugBindings() {
746 if (!debug_fn
.glXBindTexImageEXTFn
) {
747 debug_fn
.glXBindTexImageEXTFn
= fn
.glXBindTexImageEXTFn
;
748 fn
.glXBindTexImageEXTFn
= Debug_glXBindTexImageEXT
;
750 if (!debug_fn
.glXChooseFBConfigFn
) {
751 debug_fn
.glXChooseFBConfigFn
= fn
.glXChooseFBConfigFn
;
752 fn
.glXChooseFBConfigFn
= Debug_glXChooseFBConfig
;
754 if (!debug_fn
.glXChooseVisualFn
) {
755 debug_fn
.glXChooseVisualFn
= fn
.glXChooseVisualFn
;
756 fn
.glXChooseVisualFn
= Debug_glXChooseVisual
;
758 if (!debug_fn
.glXCopyContextFn
) {
759 debug_fn
.glXCopyContextFn
= fn
.glXCopyContextFn
;
760 fn
.glXCopyContextFn
= Debug_glXCopyContext
;
762 if (!debug_fn
.glXCopySubBufferMESAFn
) {
763 debug_fn
.glXCopySubBufferMESAFn
= fn
.glXCopySubBufferMESAFn
;
764 fn
.glXCopySubBufferMESAFn
= Debug_glXCopySubBufferMESA
;
766 if (!debug_fn
.glXCreateContextFn
) {
767 debug_fn
.glXCreateContextFn
= fn
.glXCreateContextFn
;
768 fn
.glXCreateContextFn
= Debug_glXCreateContext
;
770 if (!debug_fn
.glXCreateContextAttribsARBFn
) {
771 debug_fn
.glXCreateContextAttribsARBFn
= fn
.glXCreateContextAttribsARBFn
;
772 fn
.glXCreateContextAttribsARBFn
= Debug_glXCreateContextAttribsARB
;
774 if (!debug_fn
.glXCreateGLXPixmapFn
) {
775 debug_fn
.glXCreateGLXPixmapFn
= fn
.glXCreateGLXPixmapFn
;
776 fn
.glXCreateGLXPixmapFn
= Debug_glXCreateGLXPixmap
;
778 if (!debug_fn
.glXCreateNewContextFn
) {
779 debug_fn
.glXCreateNewContextFn
= fn
.glXCreateNewContextFn
;
780 fn
.glXCreateNewContextFn
= Debug_glXCreateNewContext
;
782 if (!debug_fn
.glXCreatePbufferFn
) {
783 debug_fn
.glXCreatePbufferFn
= fn
.glXCreatePbufferFn
;
784 fn
.glXCreatePbufferFn
= Debug_glXCreatePbuffer
;
786 if (!debug_fn
.glXCreatePixmapFn
) {
787 debug_fn
.glXCreatePixmapFn
= fn
.glXCreatePixmapFn
;
788 fn
.glXCreatePixmapFn
= Debug_glXCreatePixmap
;
790 if (!debug_fn
.glXCreateWindowFn
) {
791 debug_fn
.glXCreateWindowFn
= fn
.glXCreateWindowFn
;
792 fn
.glXCreateWindowFn
= Debug_glXCreateWindow
;
794 if (!debug_fn
.glXDestroyContextFn
) {
795 debug_fn
.glXDestroyContextFn
= fn
.glXDestroyContextFn
;
796 fn
.glXDestroyContextFn
= Debug_glXDestroyContext
;
798 if (!debug_fn
.glXDestroyGLXPixmapFn
) {
799 debug_fn
.glXDestroyGLXPixmapFn
= fn
.glXDestroyGLXPixmapFn
;
800 fn
.glXDestroyGLXPixmapFn
= Debug_glXDestroyGLXPixmap
;
802 if (!debug_fn
.glXDestroyPbufferFn
) {
803 debug_fn
.glXDestroyPbufferFn
= fn
.glXDestroyPbufferFn
;
804 fn
.glXDestroyPbufferFn
= Debug_glXDestroyPbuffer
;
806 if (!debug_fn
.glXDestroyPixmapFn
) {
807 debug_fn
.glXDestroyPixmapFn
= fn
.glXDestroyPixmapFn
;
808 fn
.glXDestroyPixmapFn
= Debug_glXDestroyPixmap
;
810 if (!debug_fn
.glXDestroyWindowFn
) {
811 debug_fn
.glXDestroyWindowFn
= fn
.glXDestroyWindowFn
;
812 fn
.glXDestroyWindowFn
= Debug_glXDestroyWindow
;
814 if (!debug_fn
.glXGetClientStringFn
) {
815 debug_fn
.glXGetClientStringFn
= fn
.glXGetClientStringFn
;
816 fn
.glXGetClientStringFn
= Debug_glXGetClientString
;
818 if (!debug_fn
.glXGetConfigFn
) {
819 debug_fn
.glXGetConfigFn
= fn
.glXGetConfigFn
;
820 fn
.glXGetConfigFn
= Debug_glXGetConfig
;
822 if (!debug_fn
.glXGetCurrentContextFn
) {
823 debug_fn
.glXGetCurrentContextFn
= fn
.glXGetCurrentContextFn
;
824 fn
.glXGetCurrentContextFn
= Debug_glXGetCurrentContext
;
826 if (!debug_fn
.glXGetCurrentDisplayFn
) {
827 debug_fn
.glXGetCurrentDisplayFn
= fn
.glXGetCurrentDisplayFn
;
828 fn
.glXGetCurrentDisplayFn
= Debug_glXGetCurrentDisplay
;
830 if (!debug_fn
.glXGetCurrentDrawableFn
) {
831 debug_fn
.glXGetCurrentDrawableFn
= fn
.glXGetCurrentDrawableFn
;
832 fn
.glXGetCurrentDrawableFn
= Debug_glXGetCurrentDrawable
;
834 if (!debug_fn
.glXGetCurrentReadDrawableFn
) {
835 debug_fn
.glXGetCurrentReadDrawableFn
= fn
.glXGetCurrentReadDrawableFn
;
836 fn
.glXGetCurrentReadDrawableFn
= Debug_glXGetCurrentReadDrawable
;
838 if (!debug_fn
.glXGetFBConfigAttribFn
) {
839 debug_fn
.glXGetFBConfigAttribFn
= fn
.glXGetFBConfigAttribFn
;
840 fn
.glXGetFBConfigAttribFn
= Debug_glXGetFBConfigAttrib
;
842 if (!debug_fn
.glXGetFBConfigFromVisualSGIXFn
) {
843 debug_fn
.glXGetFBConfigFromVisualSGIXFn
= fn
.glXGetFBConfigFromVisualSGIXFn
;
844 fn
.glXGetFBConfigFromVisualSGIXFn
= Debug_glXGetFBConfigFromVisualSGIX
;
846 if (!debug_fn
.glXGetFBConfigsFn
) {
847 debug_fn
.glXGetFBConfigsFn
= fn
.glXGetFBConfigsFn
;
848 fn
.glXGetFBConfigsFn
= Debug_glXGetFBConfigs
;
850 if (!debug_fn
.glXGetMscRateOMLFn
) {
851 debug_fn
.glXGetMscRateOMLFn
= fn
.glXGetMscRateOMLFn
;
852 fn
.glXGetMscRateOMLFn
= Debug_glXGetMscRateOML
;
854 if (!debug_fn
.glXGetSelectedEventFn
) {
855 debug_fn
.glXGetSelectedEventFn
= fn
.glXGetSelectedEventFn
;
856 fn
.glXGetSelectedEventFn
= Debug_glXGetSelectedEvent
;
858 if (!debug_fn
.glXGetSyncValuesOMLFn
) {
859 debug_fn
.glXGetSyncValuesOMLFn
= fn
.glXGetSyncValuesOMLFn
;
860 fn
.glXGetSyncValuesOMLFn
= Debug_glXGetSyncValuesOML
;
862 if (!debug_fn
.glXGetVisualFromFBConfigFn
) {
863 debug_fn
.glXGetVisualFromFBConfigFn
= fn
.glXGetVisualFromFBConfigFn
;
864 fn
.glXGetVisualFromFBConfigFn
= Debug_glXGetVisualFromFBConfig
;
866 if (!debug_fn
.glXIsDirectFn
) {
867 debug_fn
.glXIsDirectFn
= fn
.glXIsDirectFn
;
868 fn
.glXIsDirectFn
= Debug_glXIsDirect
;
870 if (!debug_fn
.glXMakeContextCurrentFn
) {
871 debug_fn
.glXMakeContextCurrentFn
= fn
.glXMakeContextCurrentFn
;
872 fn
.glXMakeContextCurrentFn
= Debug_glXMakeContextCurrent
;
874 if (!debug_fn
.glXMakeCurrentFn
) {
875 debug_fn
.glXMakeCurrentFn
= fn
.glXMakeCurrentFn
;
876 fn
.glXMakeCurrentFn
= Debug_glXMakeCurrent
;
878 if (!debug_fn
.glXQueryContextFn
) {
879 debug_fn
.glXQueryContextFn
= fn
.glXQueryContextFn
;
880 fn
.glXQueryContextFn
= Debug_glXQueryContext
;
882 if (!debug_fn
.glXQueryDrawableFn
) {
883 debug_fn
.glXQueryDrawableFn
= fn
.glXQueryDrawableFn
;
884 fn
.glXQueryDrawableFn
= Debug_glXQueryDrawable
;
886 if (!debug_fn
.glXQueryExtensionFn
) {
887 debug_fn
.glXQueryExtensionFn
= fn
.glXQueryExtensionFn
;
888 fn
.glXQueryExtensionFn
= Debug_glXQueryExtension
;
890 if (!debug_fn
.glXQueryExtensionsStringFn
) {
891 debug_fn
.glXQueryExtensionsStringFn
= fn
.glXQueryExtensionsStringFn
;
892 fn
.glXQueryExtensionsStringFn
= Debug_glXQueryExtensionsString
;
894 if (!debug_fn
.glXQueryServerStringFn
) {
895 debug_fn
.glXQueryServerStringFn
= fn
.glXQueryServerStringFn
;
896 fn
.glXQueryServerStringFn
= Debug_glXQueryServerString
;
898 if (!debug_fn
.glXQueryVersionFn
) {
899 debug_fn
.glXQueryVersionFn
= fn
.glXQueryVersionFn
;
900 fn
.glXQueryVersionFn
= Debug_glXQueryVersion
;
902 if (!debug_fn
.glXReleaseTexImageEXTFn
) {
903 debug_fn
.glXReleaseTexImageEXTFn
= fn
.glXReleaseTexImageEXTFn
;
904 fn
.glXReleaseTexImageEXTFn
= Debug_glXReleaseTexImageEXT
;
906 if (!debug_fn
.glXSelectEventFn
) {
907 debug_fn
.glXSelectEventFn
= fn
.glXSelectEventFn
;
908 fn
.glXSelectEventFn
= Debug_glXSelectEvent
;
910 if (!debug_fn
.glXSwapBuffersFn
) {
911 debug_fn
.glXSwapBuffersFn
= fn
.glXSwapBuffersFn
;
912 fn
.glXSwapBuffersFn
= Debug_glXSwapBuffers
;
914 if (!debug_fn
.glXSwapIntervalEXTFn
) {
915 debug_fn
.glXSwapIntervalEXTFn
= fn
.glXSwapIntervalEXTFn
;
916 fn
.glXSwapIntervalEXTFn
= Debug_glXSwapIntervalEXT
;
918 if (!debug_fn
.glXSwapIntervalMESAFn
) {
919 debug_fn
.glXSwapIntervalMESAFn
= fn
.glXSwapIntervalMESAFn
;
920 fn
.glXSwapIntervalMESAFn
= Debug_glXSwapIntervalMESA
;
922 if (!debug_fn
.glXUseXFontFn
) {
923 debug_fn
.glXUseXFontFn
= fn
.glXUseXFontFn
;
924 fn
.glXUseXFontFn
= Debug_glXUseXFont
;
926 if (!debug_fn
.glXWaitGLFn
) {
927 debug_fn
.glXWaitGLFn
= fn
.glXWaitGLFn
;
928 fn
.glXWaitGLFn
= Debug_glXWaitGL
;
930 if (!debug_fn
.glXWaitVideoSyncSGIFn
) {
931 debug_fn
.glXWaitVideoSyncSGIFn
= fn
.glXWaitVideoSyncSGIFn
;
932 fn
.glXWaitVideoSyncSGIFn
= Debug_glXWaitVideoSyncSGI
;
934 if (!debug_fn
.glXWaitXFn
) {
935 debug_fn
.glXWaitXFn
= fn
.glXWaitXFn
;
936 fn
.glXWaitXFn
= Debug_glXWaitX
;
938 g_debugBindingsInitialized
= true;
941 void DriverGLX::ClearBindings() {
942 memset(this, 0, sizeof(*this));
945 void GLXApiBase::glXBindTexImageEXTFn(Display
* dpy
,
946 GLXDrawable drawable
,
949 driver_
->fn
.glXBindTexImageEXTFn(dpy
, drawable
, buffer
, attribList
);
952 GLXFBConfig
* GLXApiBase::glXChooseFBConfigFn(Display
* dpy
,
954 const int* attribList
,
956 return driver_
->fn
.glXChooseFBConfigFn(dpy
, screen
, attribList
, nitems
);
959 XVisualInfo
* GLXApiBase::glXChooseVisualFn(Display
* dpy
,
962 return driver_
->fn
.glXChooseVisualFn(dpy
, screen
, attribList
);
965 void GLXApiBase::glXCopyContextFn(Display
* dpy
,
968 unsigned long mask
) {
969 driver_
->fn
.glXCopyContextFn(dpy
, src
, dst
, mask
);
972 void GLXApiBase::glXCopySubBufferMESAFn(Display
* dpy
,
973 GLXDrawable drawable
,
978 driver_
->fn
.glXCopySubBufferMESAFn(dpy
, drawable
, x
, y
, width
, height
);
981 GLXContext
GLXApiBase::glXCreateContextFn(Display
* dpy
,
983 GLXContext shareList
,
985 return driver_
->fn
.glXCreateContextFn(dpy
, vis
, shareList
, direct
);
988 GLXContext
GLXApiBase::glXCreateContextAttribsARBFn(Display
* dpy
,
990 GLXContext share_context
,
992 const int* attrib_list
) {
993 return driver_
->fn
.glXCreateContextAttribsARBFn(dpy
, config
, share_context
,
994 direct
, attrib_list
);
997 GLXPixmap
GLXApiBase::glXCreateGLXPixmapFn(Display
* dpy
,
1000 return driver_
->fn
.glXCreateGLXPixmapFn(dpy
, visual
, pixmap
);
1003 GLXContext
GLXApiBase::glXCreateNewContextFn(Display
* dpy
,
1006 GLXContext shareList
,
1008 return driver_
->fn
.glXCreateNewContextFn(dpy
, config
, renderType
, shareList
,
1012 GLXPbuffer
GLXApiBase::glXCreatePbufferFn(Display
* dpy
,
1014 const int* attribList
) {
1015 return driver_
->fn
.glXCreatePbufferFn(dpy
, config
, attribList
);
1018 GLXPixmap
GLXApiBase::glXCreatePixmapFn(Display
* dpy
,
1021 const int* attribList
) {
1022 return driver_
->fn
.glXCreatePixmapFn(dpy
, config
, pixmap
, attribList
);
1025 GLXWindow
GLXApiBase::glXCreateWindowFn(Display
* dpy
,
1028 const int* attribList
) {
1029 return driver_
->fn
.glXCreateWindowFn(dpy
, config
, win
, attribList
);
1032 void GLXApiBase::glXDestroyContextFn(Display
* dpy
, GLXContext ctx
) {
1033 driver_
->fn
.glXDestroyContextFn(dpy
, ctx
);
1036 void GLXApiBase::glXDestroyGLXPixmapFn(Display
* dpy
, GLXPixmap pixmap
) {
1037 driver_
->fn
.glXDestroyGLXPixmapFn(dpy
, pixmap
);
1040 void GLXApiBase::glXDestroyPbufferFn(Display
* dpy
, GLXPbuffer pbuf
) {
1041 driver_
->fn
.glXDestroyPbufferFn(dpy
, pbuf
);
1044 void GLXApiBase::glXDestroyPixmapFn(Display
* dpy
, GLXPixmap pixmap
) {
1045 driver_
->fn
.glXDestroyPixmapFn(dpy
, pixmap
);
1048 void GLXApiBase::glXDestroyWindowFn(Display
* dpy
, GLXWindow window
) {
1049 driver_
->fn
.glXDestroyWindowFn(dpy
, window
);
1052 const char* GLXApiBase::glXGetClientStringFn(Display
* dpy
, int name
) {
1053 return driver_
->fn
.glXGetClientStringFn(dpy
, name
);
1056 int GLXApiBase::glXGetConfigFn(Display
* dpy
,
1057 XVisualInfo
* visual
,
1060 return driver_
->fn
.glXGetConfigFn(dpy
, visual
, attrib
, value
);
1063 GLXContext
GLXApiBase::glXGetCurrentContextFn(void) {
1064 return driver_
->fn
.glXGetCurrentContextFn();
1067 Display
* GLXApiBase::glXGetCurrentDisplayFn(void) {
1068 return driver_
->fn
.glXGetCurrentDisplayFn();
1071 GLXDrawable
GLXApiBase::glXGetCurrentDrawableFn(void) {
1072 return driver_
->fn
.glXGetCurrentDrawableFn();
1075 GLXDrawable
GLXApiBase::glXGetCurrentReadDrawableFn(void) {
1076 return driver_
->fn
.glXGetCurrentReadDrawableFn();
1079 int GLXApiBase::glXGetFBConfigAttribFn(Display
* dpy
,
1083 return driver_
->fn
.glXGetFBConfigAttribFn(dpy
, config
, attribute
, value
);
1086 GLXFBConfig
GLXApiBase::glXGetFBConfigFromVisualSGIXFn(
1088 XVisualInfo
* visualInfo
) {
1089 return driver_
->fn
.glXGetFBConfigFromVisualSGIXFn(dpy
, visualInfo
);
1092 GLXFBConfig
* GLXApiBase::glXGetFBConfigsFn(Display
* dpy
,
1095 return driver_
->fn
.glXGetFBConfigsFn(dpy
, screen
, nelements
);
1098 bool GLXApiBase::glXGetMscRateOMLFn(Display
* dpy
,
1099 GLXDrawable drawable
,
1101 int32
* denominator
) {
1102 return driver_
->fn
.glXGetMscRateOMLFn(dpy
, drawable
, numerator
, denominator
);
1105 void GLXApiBase::glXGetSelectedEventFn(Display
* dpy
,
1106 GLXDrawable drawable
,
1107 unsigned long* mask
) {
1108 driver_
->fn
.glXGetSelectedEventFn(dpy
, drawable
, mask
);
1111 bool GLXApiBase::glXGetSyncValuesOMLFn(Display
* dpy
,
1112 GLXDrawable drawable
,
1116 return driver_
->fn
.glXGetSyncValuesOMLFn(dpy
, drawable
, ust
, msc
, sbc
);
1119 XVisualInfo
* GLXApiBase::glXGetVisualFromFBConfigFn(Display
* dpy
,
1120 GLXFBConfig config
) {
1121 return driver_
->fn
.glXGetVisualFromFBConfigFn(dpy
, config
);
1124 int GLXApiBase::glXIsDirectFn(Display
* dpy
, GLXContext ctx
) {
1125 return driver_
->fn
.glXIsDirectFn(dpy
, ctx
);
1128 int GLXApiBase::glXMakeContextCurrentFn(Display
* dpy
,
1132 return driver_
->fn
.glXMakeContextCurrentFn(dpy
, draw
, read
, ctx
);
1135 int GLXApiBase::glXMakeCurrentFn(Display
* dpy
,
1136 GLXDrawable drawable
,
1138 return driver_
->fn
.glXMakeCurrentFn(dpy
, drawable
, ctx
);
1141 int GLXApiBase::glXQueryContextFn(Display
* dpy
,
1145 return driver_
->fn
.glXQueryContextFn(dpy
, ctx
, attribute
, value
);
1148 void GLXApiBase::glXQueryDrawableFn(Display
* dpy
,
1151 unsigned int* value
) {
1152 driver_
->fn
.glXQueryDrawableFn(dpy
, draw
, attribute
, value
);
1155 int GLXApiBase::glXQueryExtensionFn(Display
* dpy
, int* errorb
, int* event
) {
1156 return driver_
->fn
.glXQueryExtensionFn(dpy
, errorb
, event
);
1159 const char* GLXApiBase::glXQueryExtensionsStringFn(Display
* dpy
, int screen
) {
1160 return driver_
->fn
.glXQueryExtensionsStringFn(dpy
, screen
);
1163 const char* GLXApiBase::glXQueryServerStringFn(Display
* dpy
,
1166 return driver_
->fn
.glXQueryServerStringFn(dpy
, screen
, name
);
1169 int GLXApiBase::glXQueryVersionFn(Display
* dpy
, int* maj
, int* min
) {
1170 return driver_
->fn
.glXQueryVersionFn(dpy
, maj
, min
);
1173 void GLXApiBase::glXReleaseTexImageEXTFn(Display
* dpy
,
1174 GLXDrawable drawable
,
1176 driver_
->fn
.glXReleaseTexImageEXTFn(dpy
, drawable
, buffer
);
1179 void GLXApiBase::glXSelectEventFn(Display
* dpy
,
1180 GLXDrawable drawable
,
1181 unsigned long mask
) {
1182 driver_
->fn
.glXSelectEventFn(dpy
, drawable
, mask
);
1185 void GLXApiBase::glXSwapBuffersFn(Display
* dpy
, GLXDrawable drawable
) {
1186 driver_
->fn
.glXSwapBuffersFn(dpy
, drawable
);
1189 void GLXApiBase::glXSwapIntervalEXTFn(Display
* dpy
,
1190 GLXDrawable drawable
,
1192 driver_
->fn
.glXSwapIntervalEXTFn(dpy
, drawable
, interval
);
1195 void GLXApiBase::glXSwapIntervalMESAFn(unsigned int interval
) {
1196 driver_
->fn
.glXSwapIntervalMESAFn(interval
);
1199 void GLXApiBase::glXUseXFontFn(Font font
, int first
, int count
, int list
) {
1200 driver_
->fn
.glXUseXFontFn(font
, first
, count
, list
);
1203 void GLXApiBase::glXWaitGLFn(void) {
1204 driver_
->fn
.glXWaitGLFn();
1207 int GLXApiBase::glXWaitVideoSyncSGIFn(int divisor
,
1209 unsigned int* count
) {
1210 return driver_
->fn
.glXWaitVideoSyncSGIFn(divisor
, remainder
, count
);
1213 void GLXApiBase::glXWaitXFn(void) {
1214 driver_
->fn
.glXWaitXFn();
1217 void TraceGLXApi::glXBindTexImageEXTFn(Display
* dpy
,
1218 GLXDrawable drawable
,
1221 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXBindTexImageEXT")
1222 glx_api_
->glXBindTexImageEXTFn(dpy
, drawable
, buffer
, attribList
);
1225 GLXFBConfig
* TraceGLXApi::glXChooseFBConfigFn(Display
* dpy
,
1227 const int* attribList
,
1229 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXChooseFBConfig")
1230 return glx_api_
->glXChooseFBConfigFn(dpy
, screen
, attribList
, nitems
);
1233 XVisualInfo
* TraceGLXApi::glXChooseVisualFn(Display
* dpy
,
1236 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXChooseVisual")
1237 return glx_api_
->glXChooseVisualFn(dpy
, screen
, attribList
);
1240 void TraceGLXApi::glXCopyContextFn(Display
* dpy
,
1243 unsigned long mask
) {
1244 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCopyContext")
1245 glx_api_
->glXCopyContextFn(dpy
, src
, dst
, mask
);
1248 void TraceGLXApi::glXCopySubBufferMESAFn(Display
* dpy
,
1249 GLXDrawable drawable
,
1254 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCopySubBufferMESA")
1255 glx_api_
->glXCopySubBufferMESAFn(dpy
, drawable
, x
, y
, width
, height
);
1258 GLXContext
TraceGLXApi::glXCreateContextFn(Display
* dpy
,
1260 GLXContext shareList
,
1262 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateContext")
1263 return glx_api_
->glXCreateContextFn(dpy
, vis
, shareList
, direct
);
1266 GLXContext
TraceGLXApi::glXCreateContextAttribsARBFn(Display
* dpy
,
1268 GLXContext share_context
,
1270 const int* attrib_list
) {
1271 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateContextAttribsARB")
1272 return glx_api_
->glXCreateContextAttribsARBFn(dpy
, config
, share_context
,
1273 direct
, attrib_list
);
1276 GLXPixmap
TraceGLXApi::glXCreateGLXPixmapFn(Display
* dpy
,
1277 XVisualInfo
* visual
,
1279 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateGLXPixmap")
1280 return glx_api_
->glXCreateGLXPixmapFn(dpy
, visual
, pixmap
);
1283 GLXContext
TraceGLXApi::glXCreateNewContextFn(Display
* dpy
,
1286 GLXContext shareList
,
1288 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateNewContext")
1289 return glx_api_
->glXCreateNewContextFn(dpy
, config
, renderType
, shareList
,
1293 GLXPbuffer
TraceGLXApi::glXCreatePbufferFn(Display
* dpy
,
1295 const int* attribList
) {
1296 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreatePbuffer")
1297 return glx_api_
->glXCreatePbufferFn(dpy
, config
, attribList
);
1300 GLXPixmap
TraceGLXApi::glXCreatePixmapFn(Display
* dpy
,
1303 const int* attribList
) {
1304 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreatePixmap")
1305 return glx_api_
->glXCreatePixmapFn(dpy
, config
, pixmap
, attribList
);
1308 GLXWindow
TraceGLXApi::glXCreateWindowFn(Display
* dpy
,
1311 const int* attribList
) {
1312 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXCreateWindow")
1313 return glx_api_
->glXCreateWindowFn(dpy
, config
, win
, attribList
);
1316 void TraceGLXApi::glXDestroyContextFn(Display
* dpy
, GLXContext ctx
) {
1317 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyContext")
1318 glx_api_
->glXDestroyContextFn(dpy
, ctx
);
1321 void TraceGLXApi::glXDestroyGLXPixmapFn(Display
* dpy
, GLXPixmap pixmap
) {
1322 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyGLXPixmap")
1323 glx_api_
->glXDestroyGLXPixmapFn(dpy
, pixmap
);
1326 void TraceGLXApi::glXDestroyPbufferFn(Display
* dpy
, GLXPbuffer pbuf
) {
1327 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyPbuffer")
1328 glx_api_
->glXDestroyPbufferFn(dpy
, pbuf
);
1331 void TraceGLXApi::glXDestroyPixmapFn(Display
* dpy
, GLXPixmap pixmap
) {
1332 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyPixmap")
1333 glx_api_
->glXDestroyPixmapFn(dpy
, pixmap
);
1336 void TraceGLXApi::glXDestroyWindowFn(Display
* dpy
, GLXWindow window
) {
1337 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXDestroyWindow")
1338 glx_api_
->glXDestroyWindowFn(dpy
, window
);
1341 const char* TraceGLXApi::glXGetClientStringFn(Display
* dpy
, int name
) {
1342 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetClientString")
1343 return glx_api_
->glXGetClientStringFn(dpy
, name
);
1346 int TraceGLXApi::glXGetConfigFn(Display
* dpy
,
1347 XVisualInfo
* visual
,
1350 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetConfig")
1351 return glx_api_
->glXGetConfigFn(dpy
, visual
, attrib
, value
);
1354 GLXContext
TraceGLXApi::glXGetCurrentContextFn(void) {
1355 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentContext")
1356 return glx_api_
->glXGetCurrentContextFn();
1359 Display
* TraceGLXApi::glXGetCurrentDisplayFn(void) {
1360 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentDisplay")
1361 return glx_api_
->glXGetCurrentDisplayFn();
1364 GLXDrawable
TraceGLXApi::glXGetCurrentDrawableFn(void) {
1365 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentDrawable")
1366 return glx_api_
->glXGetCurrentDrawableFn();
1369 GLXDrawable
TraceGLXApi::glXGetCurrentReadDrawableFn(void) {
1370 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetCurrentReadDrawable")
1371 return glx_api_
->glXGetCurrentReadDrawableFn();
1374 int TraceGLXApi::glXGetFBConfigAttribFn(Display
* dpy
,
1378 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetFBConfigAttrib")
1379 return glx_api_
->glXGetFBConfigAttribFn(dpy
, config
, attribute
, value
);
1382 GLXFBConfig
TraceGLXApi::glXGetFBConfigFromVisualSGIXFn(
1384 XVisualInfo
* visualInfo
) {
1385 TRACE_EVENT_BINARY_EFFICIENT0("gpu",
1386 "TraceGLAPI::glXGetFBConfigFromVisualSGIX")
1387 return glx_api_
->glXGetFBConfigFromVisualSGIXFn(dpy
, visualInfo
);
1390 GLXFBConfig
* TraceGLXApi::glXGetFBConfigsFn(Display
* dpy
,
1393 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetFBConfigs")
1394 return glx_api_
->glXGetFBConfigsFn(dpy
, screen
, nelements
);
1397 bool TraceGLXApi::glXGetMscRateOMLFn(Display
* dpy
,
1398 GLXDrawable drawable
,
1400 int32
* denominator
) {
1401 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetMscRateOML")
1402 return glx_api_
->glXGetMscRateOMLFn(dpy
, drawable
, numerator
, denominator
);
1405 void TraceGLXApi::glXGetSelectedEventFn(Display
* dpy
,
1406 GLXDrawable drawable
,
1407 unsigned long* mask
) {
1408 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetSelectedEvent")
1409 glx_api_
->glXGetSelectedEventFn(dpy
, drawable
, mask
);
1412 bool TraceGLXApi::glXGetSyncValuesOMLFn(Display
* dpy
,
1413 GLXDrawable drawable
,
1417 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetSyncValuesOML")
1418 return glx_api_
->glXGetSyncValuesOMLFn(dpy
, drawable
, ust
, msc
, sbc
);
1421 XVisualInfo
* TraceGLXApi::glXGetVisualFromFBConfigFn(Display
* dpy
,
1422 GLXFBConfig config
) {
1423 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXGetVisualFromFBConfig")
1424 return glx_api_
->glXGetVisualFromFBConfigFn(dpy
, config
);
1427 int TraceGLXApi::glXIsDirectFn(Display
* dpy
, GLXContext ctx
) {
1428 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXIsDirect")
1429 return glx_api_
->glXIsDirectFn(dpy
, ctx
);
1432 int TraceGLXApi::glXMakeContextCurrentFn(Display
* dpy
,
1436 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXMakeContextCurrent")
1437 return glx_api_
->glXMakeContextCurrentFn(dpy
, draw
, read
, ctx
);
1440 int TraceGLXApi::glXMakeCurrentFn(Display
* dpy
,
1441 GLXDrawable drawable
,
1443 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXMakeCurrent")
1444 return glx_api_
->glXMakeCurrentFn(dpy
, drawable
, ctx
);
1447 int TraceGLXApi::glXQueryContextFn(Display
* dpy
,
1451 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryContext")
1452 return glx_api_
->glXQueryContextFn(dpy
, ctx
, attribute
, value
);
1455 void TraceGLXApi::glXQueryDrawableFn(Display
* dpy
,
1458 unsigned int* value
) {
1459 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryDrawable")
1460 glx_api_
->glXQueryDrawableFn(dpy
, draw
, attribute
, value
);
1463 int TraceGLXApi::glXQueryExtensionFn(Display
* dpy
, int* errorb
, int* event
) {
1464 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryExtension")
1465 return glx_api_
->glXQueryExtensionFn(dpy
, errorb
, event
);
1468 const char* TraceGLXApi::glXQueryExtensionsStringFn(Display
* dpy
, int screen
) {
1469 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryExtensionsString")
1470 return glx_api_
->glXQueryExtensionsStringFn(dpy
, screen
);
1473 const char* TraceGLXApi::glXQueryServerStringFn(Display
* dpy
,
1476 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryServerString")
1477 return glx_api_
->glXQueryServerStringFn(dpy
, screen
, name
);
1480 int TraceGLXApi::glXQueryVersionFn(Display
* dpy
, int* maj
, int* min
) {
1481 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXQueryVersion")
1482 return glx_api_
->glXQueryVersionFn(dpy
, maj
, min
);
1485 void TraceGLXApi::glXReleaseTexImageEXTFn(Display
* dpy
,
1486 GLXDrawable drawable
,
1488 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXReleaseTexImageEXT")
1489 glx_api_
->glXReleaseTexImageEXTFn(dpy
, drawable
, buffer
);
1492 void TraceGLXApi::glXSelectEventFn(Display
* dpy
,
1493 GLXDrawable drawable
,
1494 unsigned long mask
) {
1495 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSelectEvent")
1496 glx_api_
->glXSelectEventFn(dpy
, drawable
, mask
);
1499 void TraceGLXApi::glXSwapBuffersFn(Display
* dpy
, GLXDrawable drawable
) {
1500 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapBuffers")
1501 glx_api_
->glXSwapBuffersFn(dpy
, drawable
);
1504 void TraceGLXApi::glXSwapIntervalEXTFn(Display
* dpy
,
1505 GLXDrawable drawable
,
1507 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapIntervalEXT")
1508 glx_api_
->glXSwapIntervalEXTFn(dpy
, drawable
, interval
);
1511 void TraceGLXApi::glXSwapIntervalMESAFn(unsigned int interval
) {
1512 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXSwapIntervalMESA")
1513 glx_api_
->glXSwapIntervalMESAFn(interval
);
1516 void TraceGLXApi::glXUseXFontFn(Font font
, int first
, int count
, int list
) {
1517 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXUseXFont")
1518 glx_api_
->glXUseXFontFn(font
, first
, count
, list
);
1521 void TraceGLXApi::glXWaitGLFn(void) {
1522 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitGL")
1523 glx_api_
->glXWaitGLFn();
1526 int TraceGLXApi::glXWaitVideoSyncSGIFn(int divisor
,
1528 unsigned int* count
) {
1529 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitVideoSyncSGI")
1530 return glx_api_
->glXWaitVideoSyncSGIFn(divisor
, remainder
, count
);
1533 void TraceGLXApi::glXWaitXFn(void) {
1534 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glXWaitX")
1535 glx_api_
->glXWaitXFn();