]> git.cworth.org Git - fips/blob - glwrap.c
Aggregate non-shader GPU operations into their own operations
[fips] / glwrap.c
1 /* Copyright © 2013, Intel Corporation
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  */
21
22 #include "dlwrap.h"
23
24 /* The prototypes for some OpenGL functions changed at one point from:
25  *
26  *      const void* *indices
27  * to:
28  *      const void* const coist *indices
29  *
30  * This makes it difficult for us to provide an implementation of
31  * these functions that is consistent with the locally-available gl.h
32  * since we don't know if the extra const will be present or not.
33  *
34  * To workaround this problem, we simply #define away const altogether
35  * before including gl.h.
36  *
37  * Kudos to Keith Packard for suggesting this kludge.
38  */
39 #define const
40
41 #define GL_GLEXT_PROTOTYPES
42 #include <GL/gl.h>
43
44 #include "fips.h"
45
46 #include "glwrap.h"
47
48 #include "metrics.h"
49
50 static void *gl_handle;
51
52 #define SWITCH_METRICS_OP(op)                   \
53         metrics_counter_stop ();                \
54         metrics_set_current_op (op);            \
55         metrics_counter_start ();
56
57 void
58 glwrap_set_gl_handle (void *handle)
59 {
60         if (gl_handle == NULL)
61                 gl_handle = handle;
62 }
63
64 void *
65 glwrap_lookup (char *name)
66 {
67         void *ret;
68
69         /* We don't call dlopen here to find the library in which to
70          * perform a dlsym lookup. That's because the application may
71          * be loading libGL.so or libGLESv2.so for its OpenGL symbols.
72          *
73          * So we instead watch for one of those filenames to go by in
74          * our dlopen wrapper, which will then call
75          * glwrap_set_gl_handle to give us the handle to use here.
76          *
77          * If the application hasn't called dlopen on a "libGL"
78          * library, then presumably the application is linked directly
79          * to an OpenGL implementation. In this case, we can use
80          * RTLD_NEXT to find the symbol.
81          *
82          * But just in case, we also let the user override that by
83          * specifying the FIPS_LIBGL environment variable to the path
84          * of the real libGL.so library that fips should dlopen here.
85          */
86         if (gl_handle == NULL) {
87                 const char *path;
88
89                 path = getenv ("FIPS_LIBGL");
90                 if (path) {
91                         gl_handle = dlopen (path, RTLD_LAZY);
92
93                         if (gl_handle == NULL) {
94                                 fprintf (stderr, "Failed to dlopen FIPS_LIBGL: "
95                                          "%s\n", path);
96                                 exit (1);
97                         }
98                 } else {
99                         gl_handle = RTLD_NEXT;
100                 }
101         }
102
103         ret = dlwrap_real_dlsym (gl_handle, name);
104
105         if (ret == NULL) {
106                 fprintf (stderr, "Error: glwrap_lookup failed to dlsym %s\n",
107                          name);
108                 exit (1);
109         }
110
111         return ret;
112 }
113
114 /* With a program change, we stop the counter, update the
115  * active program, then start the counter up again. */
116 void
117 glUseProgram (GLuint program)
118 {
119         SWITCH_METRICS_OP (METRICS_OP_SHADER + program);
120
121         GLWRAP_DEFER(glUseProgram, program);
122 }
123
124 void
125 glUseProgramObjectARB (GLhandleARB programObj)
126 {
127         SWITCH_METRICS_OP (METRICS_OP_SHADER + programObj);
128
129         GLWRAP_DEFER(glUseProgramObjectARB, programObj);
130 }
131
132 /* METRICS_OP_ACCUM */
133 void
134 glAccum (GLenum op, GLfloat value)
135 {
136         SWITCH_METRICS_OP (METRICS_OP_ACCUM);
137
138         GLWRAP_DEFER (glAccum, op, value);
139 }
140
141 void
142 glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
143 {
144         SWITCH_METRICS_OP (METRICS_OP_ACCUM);
145
146         GLWRAP_DEFER (glClearAccum, red, green, blue, alpha);
147 }
148
149 void
150 glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
151 {
152         SWITCH_METRICS_OP (METRICS_OP_ACCUM);
153
154         GLWRAP_DEFER (glClearAccumxOES, red, green, blue, alpha);
155 }
156
157 /* METRICS_OP_BUFFER_DATA */
158 void
159 glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
160 {
161         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
162
163         GLWRAP_DEFER (glBufferData, target, size, data, usage);
164 }
165
166 void
167 glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data,
168                       GLenum usage)
169 {
170         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
171
172         GLWRAP_DEFER (glNamedBufferDataEXT, buffer, size, data, usage);
173 }
174
175 void
176 glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size,
177                  const GLvoid *data)
178 {
179         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
180
181         GLWRAP_DEFER (glBufferSubData, target, offset, size, data);
182 }
183
184 void
185 glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size,
186                          const GLvoid *data)
187 {
188         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
189
190         GLWRAP_DEFER (glNamedBufferSubDataEXT, buffer, offset, size, data);
191 }
192
193 void *
194 glMapBuffer (GLenum target, GLenum access)
195 {
196         void *ret;
197
198         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
199
200         GLWRAP_DEFER_WITH_RETURN (ret, glMapBuffer, target, access);
201
202         return ret;
203 }
204
205 void *
206 glMapBufferARB (GLenum target, GLenum access)
207 {
208         void *ret;
209
210         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
211
212         GLWRAP_DEFER_WITH_RETURN (ret, glMapBufferARB, target, access);
213
214         return ret;
215 }
216
217 void *
218 glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length,
219                   GLbitfield access)
220 {
221         void *ret;
222
223         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
224
225         GLWRAP_DEFER_WITH_RETURN (ret, glMapBufferRange, target, offset,
226                                   length, access);
227
228         return ret;
229 }
230
231 GLboolean
232 glUnmapBuffer (GLenum target)
233 {
234         GLboolean ret;
235
236         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
237
238         GLWRAP_DEFER_WITH_RETURN (ret, glUnmapBuffer, target);
239
240         return ret;
241 }
242
243 GLboolean
244 glUnmapNamedBufferEXT (GLuint buffer)
245 {
246         GLboolean ret;
247
248         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
249
250         GLWRAP_DEFER_WITH_RETURN (ret, glUnmapNamedBufferEXT, buffer);
251
252         return ret;
253 }
254
255 GLboolean
256 glUnmapBufferARB (GLenum target)
257 {
258         GLboolean ret;
259
260         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
261
262         GLWRAP_DEFER_WITH_RETURN (ret, glUnmapBufferARB, target);
263
264         return ret;
265 }
266
267 void
268 glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length)
269 {
270         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
271
272         GLWRAP_DEFER (glFlushMappedBufferRange, target, offset, length);
273 }
274
275 void
276 glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size)
277 {
278         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
279
280         GLWRAP_DEFER (glFlushMappedBufferRangeAPPLE, target, offset, size);
281 }
282
283 void
284 glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset,
285                                   GLsizeiptr length)
286 {
287         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
288
289         GLWRAP_DEFER (glFlushMappedNamedBufferRangeEXT, buffer, offset, length);
290 }
291
292 void *
293 glMapNamedBufferEXT (GLuint buffer, GLenum access)
294 {
295         void *ret;
296
297         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
298
299         GLWRAP_DEFER_WITH_RETURN (ret, glMapNamedBufferEXT, buffer, access);
300
301         return ret;
302 }
303
304 void *
305 glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length,
306                           GLbitfield access)
307 {
308         void *ret;
309
310         SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
311
312         GLWRAP_DEFER_WITH_RETURN (ret, glMapNamedBufferRangeEXT, buffer,
313                                   offset, length, access);
314
315         return ret;
316 }
317
318 /* METRICS_OP_BUFFER_SUB_DATA */
319 void
320 glCopyBufferSubData (GLenum readTarget, GLenum writeTarget,
321                      GLintptr readOffset, GLintptr writeOffset,
322                      GLsizeiptr size)
323 {
324         SWITCH_METRICS_OP (METRICS_OP_BUFFER_SUB_DATA);
325
326         GLWRAP_DEFER (glCopyBufferSubData, readTarget, writeTarget,
327                       readOffset, writeOffset, size);
328 }
329
330 void
331 glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer,
332                              GLintptr readOffset, GLintptr writeOffset,
333                              GLsizeiptr size)
334 {
335         SWITCH_METRICS_OP (METRICS_OP_BUFFER_SUB_DATA);
336
337         GLWRAP_DEFER (glNamedCopyBufferSubDataEXT, readBuffer,
338                       writeBuffer, readOffset, writeOffset, size);
339 }
340
341 /* METRICS_OP_BITMAP */
342 void
343 glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
344           GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
345 {
346         SWITCH_METRICS_OP (METRICS_OP_BITMAP);
347
348         GLWRAP_DEFER (glBitmap, width, height, xorig, yorig,
349                       xmove, ymove, bitmap);
350 }
351
352 void
353 glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig,
354               GLfixed xmove, GLfixed ymove, const GLubyte *bitmap)
355 {
356         SWITCH_METRICS_OP (METRICS_OP_BITMAP);
357
358         GLWRAP_DEFER (glBitmapxOES, width, height, xorig, yorig,
359                       xmove, ymove, bitmap);
360 }
361
362 /* METRICS_OP_BLIT_FRAMEBUFFER */
363 void
364 glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
365                    GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
366                    GLbitfield mask, GLenum filter)
367 {
368         SWITCH_METRICS_OP (METRICS_OP_BLIT_FRAMEBUFFER);
369
370         GLWRAP_DEFER (glBlitFramebuffer, srcX0, srcY0, srcX1, srcY1,
371                       dstX0, dstY0, dstX1, dstY1, mask, filter);
372 }
373
374 void
375 glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
376                       GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
377                       GLbitfield mask, GLenum filter)
378 {
379         SWITCH_METRICS_OP (METRICS_OP_BLIT_FRAMEBUFFER);
380
381         GLWRAP_DEFER (glBlitFramebufferEXT, srcX0, srcY0, srcX1, srcY1,
382                       dstX0, dstY0, dstX1, dstY1, mask, filter);
383 }
384
385 /* METRICS_OP_CLEAR */
386 void 
387 glClear (GLbitfield mask)
388 {
389         SWITCH_METRICS_OP (METRICS_OP_CLEAR);
390
391         GLWRAP_DEFER (glClear, mask);
392 }
393
394 void
395 glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
396 {
397         SWITCH_METRICS_OP (METRICS_OP_CLEAR);
398
399         GLWRAP_DEFER (glClearBufferfi, buffer, drawbuffer, depth, stencil);
400 }
401
402 void
403 glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value)
404 {
405         SWITCH_METRICS_OP (METRICS_OP_CLEAR);
406
407         GLWRAP_DEFER (glClearBufferfv, buffer, drawbuffer, value);
408 }
409
410 void
411 glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value)
412 {
413         SWITCH_METRICS_OP (METRICS_OP_CLEAR);
414
415         GLWRAP_DEFER (glClearBufferiv, buffer, drawbuffer, value);
416 }
417
418 void
419 glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value)
420 {
421         SWITCH_METRICS_OP (METRICS_OP_CLEAR);
422
423         GLWRAP_DEFER (glClearBufferuiv, buffer, drawbuffer, value);
424 }
425
426 /* METRICS_OP_CLEAR_BUFFER_DATA */
427
428 void
429 glClearBufferData (GLenum target, GLenum internalformat, GLenum format,
430                    GLenum type, const void *data)
431 {
432         SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
433
434         GLWRAP_DEFER (glClearBufferData, target, internalformat, format,
435                       type, data);
436 }
437
438 void
439 glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset,
440                       GLsizeiptr size, GLenum format, GLenum type,
441                       const void *data)
442 {
443         SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
444
445         GLWRAP_DEFER (glClearBufferSubData, target, internalformat,
446                       offset, size, format, type, data);
447 }
448
449 void
450 glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format,
451                            GLenum type, const void *data)
452 {
453         SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
454
455         GLWRAP_DEFER (glClearNamedBufferDataEXT, buffer, internalformat,
456                       format, type, data);
457 }
458
459 void
460 glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat,
461                               GLenum format, GLenum type, GLsizeiptr offset,
462                               GLsizeiptr size, const void *data)
463 {
464         SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
465
466         GLWRAP_DEFER (glClearNamedBufferSubDataEXT, buffer,
467                       internalformat, format, type, offset, size, data);
468 }
469
470 /* METRICS_OP_CLEAR_TEX_IMAGE */
471
472
473 /* METRICS_OP_COPY_PIXELS */
474 void
475 glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type )
476 {
477         SWITCH_METRICS_OP (METRICS_OP_COPY_PIXELS);
478
479         GLWRAP_DEFER (glCopyPixels, x, y, width, height, type);
480 }
481
482 /* METRICS_OP_COPY_TEX_IMAGE */
483 void
484 glCopyTexImage1D (GLenum target, GLint level, GLenum internalformat,
485                   GLint x, GLint y, GLsizei width, GLint border)
486 {
487         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
488
489         GLWRAP_DEFER (glCopyTexImage1D, target, level, internalformat,
490                       x, y, width, border);
491 }
492
493 void
494 glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat,
495                      GLint x, GLint y, GLsizei width, GLint border)
496 {
497         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
498
499         GLWRAP_DEFER (glCopyTexImage1DEXT, target, level, internalformat,
500                       x, y, width, border);
501 }
502
503 void
504 glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat,
505                   GLint x, GLint y, GLsizei width, GLsizei height,
506                   GLint border)
507 {
508         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
509
510         GLWRAP_DEFER (glCopyTexImage2D, target, level, internalformat,
511                       x, y, width, height, border);
512 }
513
514 void
515 glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat,
516                      GLint x, GLint y, GLsizei width, GLsizei height,
517                      GLint border)
518 {
519         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
520
521         GLWRAP_DEFER (glCopyTexImage2DEXT, target, level, internalformat,
522                       x, y, width, height, border);
523 }
524
525 void
526 glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset,
527                      GLint x, GLint y, GLsizei width)
528 {
529         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
530
531         GLWRAP_DEFER (glCopyTexSubImage1D, target, level, xoffset,
532                       x, y, width);
533 }
534
535 void
536 glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset,
537                         GLint x, GLint y, GLsizei width)
538 {
539         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
540
541         GLWRAP_DEFER (glCopyTexSubImage1DEXT, target, level, xoffset,
542                       x, y, width);
543 }
544
545 void
546 glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset,
547                      GLint yoffset, GLint x, GLint y, GLsizei width,
548                      GLsizei height)
549 {
550         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
551
552         GLWRAP_DEFER (glCopyTexSubImage2D, target, level, xoffset, yoffset,
553                       x, y, width, height);
554 }
555
556 void
557 glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset,
558                         GLint yoffset, GLint x, GLint y, GLsizei width,
559                         GLsizei height)
560 {
561         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
562
563         GLWRAP_DEFER (glCopyTexSubImage2DEXT, target, level, xoffset, yoffset,
564                       x, y, width, height);
565 }
566
567 void
568 glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset,
569                      GLint yoffset, GLint zoffset, GLint x, GLint y,
570                      GLsizei width, GLsizei height)
571 {
572         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
573
574         GLWRAP_DEFER (glCopyTexSubImage3D, target, level, xoffset, yoffset,
575                       zoffset, x, y, width, height);
576 }
577
578 void
579 glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset,
580                         GLint yoffset, GLint zoffset, GLint x, GLint y,
581                         GLsizei width, GLsizei height)
582 {
583         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
584
585         GLWRAP_DEFER (glCopyTexSubImage3DEXT, target, level, xoffset, yoffset,
586                       zoffset, x, y, width, height);
587 }
588
589 void
590 glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level,
591                          GLenum internalformat, GLint x, GLint y,
592                          GLsizei width, GLint border)
593 {
594         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
595
596         GLWRAP_DEFER (glCopyTextureImage1DEXT, texture, target, level,
597                       internalformat, x, y, width, border);
598 }
599
600 void
601 glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level,
602                          GLenum internalformat, GLint x, GLint y, GLsizei width,
603                          GLsizei height, GLint border)
604 {
605         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
606
607         GLWRAP_DEFER (glCopyTextureImage2DEXT, texture, target,
608                       level, internalformat, x, y, width, height, border);
609 }
610
611 void
612 glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level,
613                             GLint xoffset, GLint x, GLint y, GLsizei width)
614 {
615         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
616
617         GLWRAP_DEFER (glCopyTextureSubImage1DEXT, texture, target, level,
618                       xoffset, x, y, width);
619 }
620
621 void
622 glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level,
623                             GLint xoffset, GLint yoffset, GLint x, GLint y,
624                             GLsizei width, GLsizei height)
625 {
626         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
627
628         GLWRAP_DEFER (glCopyTextureSubImage2DEXT, texture, target, level,
629                       xoffset, yoffset, x, y, width, height);
630 }
631
632 void
633 glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level,
634                             GLint xoffset, GLint yoffset, GLint zoffset,
635                             GLint x, GLint y, GLsizei width, GLsizei height)
636 {
637         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
638
639         GLWRAP_DEFER (glCopyTextureSubImage3DEXT, texture, target, level,
640                       xoffset, yoffset, zoffset, x, y, width, height);
641 }
642
643 void
644 glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
645                           GLenum internalformat, GLint x, GLint y,
646                           GLsizei width, GLint border)
647 {
648         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
649
650         GLWRAP_DEFER (glCopyMultiTexImage1DEXT, texunit, target, level,
651                       internalformat, x, y, width, border);
652 }
653
654 void
655 glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
656                           GLenum internalformat, GLint x, GLint y,
657                           GLsizei width, GLsizei height, GLint border)
658 {
659         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
660
661         GLWRAP_DEFER (glCopyMultiTexImage2DEXT, texunit, target, level,
662                       internalformat, x, y, width, height, border);
663 }
664
665 void
666 glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
667                              GLint xoffset, GLint x, GLint y, GLsizei width)
668 {
669         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
670
671         GLWRAP_DEFER (glCopyMultiTexSubImage1DEXT, texunit, target, level,
672                       xoffset, x, y, width);
673 }
674
675 void
676 glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
677                              GLint xoffset, GLint yoffset, GLint x, GLint y,
678                              GLsizei width, GLsizei height)
679 {
680         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
681
682         GLWRAP_DEFER (glCopyMultiTexSubImage2DEXT, texunit, target, level,
683                       xoffset, yoffset, x, y, width, height);
684 }
685
686 void
687 glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
688                              GLint xoffset, GLint yoffset, GLint zoffset,
689                              GLint x, GLint y, GLsizei width, GLsizei height)
690 {
691         SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
692
693         GLWRAP_DEFER (glCopyMultiTexSubImage3DEXT, texunit, target, level,
694                       xoffset, yoffset, zoffset, x, y, width, height);
695 }
696
697 /* METRICS_OP_DRAW_PIXELS */
698 void
699 glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type,
700               const GLvoid *pixels)
701 {
702         SWITCH_METRICS_OP (METRICS_OP_DRAW_PIXELS);
703
704         GLWRAP_DEFER (glDrawPixels, width, height, format, type, pixels);
705 }
706
707 /* METRICS_OP_GET_TEX_IMAGE */
708
709 void
710 glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target,
711                                  GLint lod, GLvoid *img)
712 {
713         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
714
715         GLWRAP_DEFER (glGetCompressedMultiTexImageEXT, texunit,
716                       target, lod, img);
717 }
718
719 void
720 glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img)
721 {
722         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
723
724         GLWRAP_DEFER (glGetCompressedTexImage, target, level, img);
725 }
726
727 void
728 glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img)
729 {
730         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
731
732         GLWRAP_DEFER (glGetCompressedTexImageARB, target, level, img);
733 }
734
735 void
736 glGetCompressedTextureImageEXT (GLuint texture, GLenum target,
737                                 GLint lod, GLvoid *img)
738 {
739         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
740
741         GLWRAP_DEFER (glGetCompressedTextureImageEXT, texture,
742                       target, lod, img);
743 }
744
745 void
746 glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level,
747                        GLenum format, GLenum type, GLvoid *pixels)
748 {
749         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
750
751         GLWRAP_DEFER (glGetMultiTexImageEXT, texunit,
752                       target, level, format, type, pixels);
753 }
754
755 void
756 glGetnCompressedTexImageARB (GLenum target, GLint lod,
757                              GLsizei bufSize, GLvoid *img)
758 {
759         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
760
761         GLWRAP_DEFER (glGetnCompressedTexImageARB, target, lod, bufSize, img);
762 }
763
764 void
765 glGetnTexImageARB (GLenum target, GLint level, GLenum format,
766                    GLenum type, GLsizei bufSize, GLvoid *img)
767 {
768         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
769
770         GLWRAP_DEFER (glGetnTexImageARB, target, level,
771                       format, type, bufSize, img);
772 }
773
774 void
775 glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type,
776                GLvoid *pixels )
777 {
778         SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
779
780         GLWRAP_DEFER (glGetTexImage, target, level, format, type, pixels);
781 }
782
783 /* METRICS_OP_READ_PIXELS */
784 void
785 glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height,
786               GLenum format, GLenum type, GLvoid *pixels )
787 {
788         SWITCH_METRICS_OP (METRICS_OP_READ_PIXELS);
789
790         GLWRAP_DEFER (glReadPixels, x, y, width, height, format, type, pixels);
791 }
792
793 void
794 glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height,
795                   GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)
796 {
797         SWITCH_METRICS_OP (METRICS_OP_READ_PIXELS);
798
799         GLWRAP_DEFER (glReadnPixelsARB, x, y, width, height,
800                       format, type, bufSize, data);
801 }
802
803 /* METRICS_OP_TEX_IMAGE */
804 void
805 glTexImage1D (GLenum target, GLint level, GLint internalFormat,
806               GLsizei width, GLint border, GLenum format, GLenum type,
807               const GLvoid *pixels)
808 {
809         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
810
811         GLWRAP_DEFER (glTexImage1D, target, level, internalFormat, width,
812                       border, format, type, pixels);
813 }
814
815 void
816 glTexImage2D (GLenum target, GLint level, GLint internalFormat,
817               GLsizei width, GLsizei height, GLint border, GLenum format,
818               GLenum type, const GLvoid *pixels )
819 {
820         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
821
822         GLWRAP_DEFER (glTexImage2D, target, level, internalFormat,
823                       width, height, border, format, type, pixels);
824 }
825
826
827 void
828 glTexImage2DMultisample (GLenum target, GLsizei samples,
829                          GLint internalformat, GLsizei width, GLsizei height,
830                          GLboolean fixedsamplelocations)
831 {
832         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
833
834         GLWRAP_DEFER (glTexImage2DMultisample, target, samples,
835                       internalformat, width, height, fixedsamplelocations);
836 }
837
838 void
839 glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples,
840                                    GLsizei colorSamples, GLint internalFormat,
841                                    GLsizei width, GLsizei height,
842                                    GLboolean fixedSampleLocations)
843 {
844         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
845
846         GLWRAP_DEFER (glTexImage2DMultisampleCoverageNV, target,
847                       coverageSamples, colorSamples, internalFormat,
848                       width, height, fixedSampleLocations);
849 }
850
851 void
852 glTexImage3D (GLenum target, GLint level, GLint internalformat,
853               GLsizei width, GLsizei height, GLsizei depth, GLint border,
854               GLenum format, GLenum type, const GLvoid *pixels)
855 {
856         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
857
858         GLWRAP_DEFER (glTexImage3D, target, level, internalformat,
859                       width, height, depth, border, format, type, pixels);
860 }
861
862 void
863 glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat,
864                  GLsizei width, GLsizei height, GLsizei depth, GLint border,
865                  GLenum format, GLenum type, const GLvoid *pixels)
866 {
867         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
868
869         GLWRAP_DEFER (glTexImage3DEXT, target, level, internalformat,
870                       width, height, depth, border, format, type, pixels);
871 }
872
873 void
874 glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat,
875                          GLsizei width, GLsizei height, GLsizei depth,
876                          GLboolean fixedsamplelocations)
877 {
878         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
879
880         GLWRAP_DEFER (glTexImage3DMultisample, target, samples,
881                       internalformat, width, height, depth,
882                       fixedsamplelocations);
883 }
884
885 void
886 glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples,
887                                    GLsizei colorSamples, GLint internalFormat,
888                                    GLsizei width, GLsizei height, GLsizei depth,
889                                    GLboolean fixedSampleLocations)
890 {
891         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
892
893         GLWRAP_DEFER (glTexImage3DMultisampleCoverageNV, target,
894                       coverageSamples, colorSamples, internalFormat,
895                       width, height, depth, fixedSampleLocations);
896 }
897
898 void
899 glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat,
900                   GLsizei width, GLsizei height, GLsizei depth,
901                   GLsizei size4d, GLint border, GLenum format,
902                   GLenum type, const GLvoid *pixels)
903 {
904         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
905
906         GLWRAP_DEFER (glTexImage4DSGIS, target, level,
907                       internalformat, width, height, depth,
908                       size4d, border, format, type, pixels);
909 }
910
911 void
912 glTexSubImage1D (GLenum target, GLint level, GLint xoffset,
913                  GLsizei width, GLenum format, GLenum type,
914                  const GLvoid *pixels)
915 {
916         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
917
918         GLWRAP_DEFER (glTexSubImage1D, target, level, xoffset,
919                       width, format, type, pixels);
920 }
921
922 void
923 glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset,
924                     GLsizei width, GLenum format, GLenum type,
925                     const GLvoid *pixels)
926 {
927         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
928
929         GLWRAP_DEFER (glTexSubImage1DEXT, target, level, xoffset,
930                       width, format, type, pixels);
931 }
932
933 void
934 glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
935                  GLsizei width, GLsizei height, GLenum format, GLenum type,
936                  const GLvoid *pixels)
937 {
938         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
939
940         GLWRAP_DEFER (glTexSubImage2D, target, level, xoffset, yoffset,
941                       width, height, format, type, pixels);
942 }
943
944 void
945 glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset,
946                     GLsizei width, GLsizei height, GLenum format, GLenum type,
947                     const GLvoid *pixels)
948 {
949         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
950
951         GLWRAP_DEFER (glTexSubImage2DEXT, target, level, xoffset, yoffset,
952                       width, height, format, type, pixels);
953 }
954
955 void
956 glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
957                  GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
958                  GLenum format, GLenum type, const GLvoid *pixels)
959 {
960         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
961
962         GLWRAP_DEFER (glTexSubImage3D, target, level, xoffset, yoffset,
963                       zoffset, width, height, depth, format, type, pixels);
964 }
965
966 void
967 glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset,
968                     GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
969                     GLenum format, GLenum type, const GLvoid *pixels)
970 {
971         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
972
973         GLWRAP_DEFER (glTexSubImage3DEXT, target, level, xoffset, yoffset,
974                       zoffset, width, height, depth, format, type, pixels);
975 }
976
977 void
978 glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset,
979                      GLint zoffset, GLint woffset, GLsizei width,
980                      GLsizei height, GLsizei depth, GLsizei size4d,
981                      GLenum format, GLenum type, const GLvoid *pixels)
982 {
983         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
984
985         GLWRAP_DEFER (glTexSubImage4DSGIS, target, level, xoffset,
986                       yoffset, zoffset, woffset, width, height,
987                       depth, size4d, format, type, pixels);
988 }
989
990 void
991 glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
992                                 GLenum internalformat, GLsizei width,
993                                 GLint border, GLsizei imageSize,
994                                 const GLvoid *bits)
995 {
996         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
997
998         GLWRAP_DEFER (glCompressedMultiTexImage1DEXT, texunit, target,
999                       level, internalformat, width, border, imageSize, bits);
1000 }
1001
1002 void
1003 glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
1004                                 GLenum internalformat, GLsizei width,
1005                                 GLsizei height, GLint border,
1006                                 GLsizei imageSize, const GLvoid *bits)
1007 {
1008         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1009
1010         GLWRAP_DEFER (glCompressedMultiTexImage2DEXT, texunit, target, level,
1011                       internalformat, width, height, border, imageSize, bits);
1012 }
1013
1014 void
1015 glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
1016                                 GLenum internalformat, GLsizei width,
1017                                 GLsizei height, GLsizei depth, GLint border,
1018                                 GLsizei imageSize, const GLvoid *bits)
1019 {
1020         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1021
1022         GLWRAP_DEFER (glCompressedMultiTexImage3DEXT, texunit, target,
1023                       level, internalformat, width, height, depth,
1024                       border, imageSize, bits);
1025 }
1026
1027 void
1028 glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
1029                                    GLint xoffset, GLsizei width, GLenum format,
1030                                    GLsizei imageSize, const GLvoid *bits)
1031 {
1032         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1033
1034         GLWRAP_DEFER (glCompressedMultiTexSubImage1DEXT, texunit, target,
1035                       level, xoffset, width, format, imageSize, bits);
1036 }
1037
1038 void
1039 glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
1040                                    GLint xoffset, GLint yoffset, GLsizei width,
1041                                    GLsizei height, GLenum format,
1042                                    GLsizei imageSize, const GLvoid *bits)
1043 {
1044         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1045
1046         GLWRAP_DEFER (glCompressedMultiTexSubImage2DEXT, texunit, target, level,
1047                       xoffset, yoffset, width, height, format, imageSize, bits);
1048 }
1049
1050 void
1051 glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
1052                                    GLint xoffset, GLint yoffset, GLint zoffset,
1053                                    GLsizei width, GLsizei height, GLsizei depth,
1054                                    GLenum format, GLsizei imageSize,
1055                                    const GLvoid *bits)
1056 {
1057         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1058
1059         GLWRAP_DEFER (glCompressedMultiTexSubImage3DEXT, texunit, target,
1060                       level, xoffset, yoffset, zoffset, width, height,
1061                       depth, format, imageSize, bits);
1062 }
1063
1064 void
1065 glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat,
1066                         GLsizei width, GLint border, GLsizei imageSize,
1067                         const GLvoid *data)
1068 {
1069         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1070
1071         GLWRAP_DEFER (glCompressedTexImage1D, target, level,
1072                       internalformat, width, border, imageSize, data);
1073 }
1074
1075 void
1076 glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat,
1077                            GLsizei width, GLint border, GLsizei imageSize,
1078                            const GLvoid *data)
1079 {
1080         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1081
1082         GLWRAP_DEFER (glCompressedTexImage1DARB, target, level, internalformat,
1083                       width, border, imageSize, data);
1084 }
1085
1086 void
1087 glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat,
1088                         GLsizei width, GLsizei height, GLint border,
1089                         GLsizei imageSize, const GLvoid *data)
1090 {
1091         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1092
1093         GLWRAP_DEFER (glCompressedTexImage2D, target, level, internalformat,
1094                       width, height, border, imageSize, data);
1095 }
1096
1097 void
1098 glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat,
1099                            GLsizei width, GLsizei height, GLint border,
1100                            GLsizei imageSize, const GLvoid *data)
1101 {
1102         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1103
1104         GLWRAP_DEFER (glCompressedTexImage2DARB, target, level, internalformat,
1105                       width, height, border, imageSize, data);
1106 }
1107
1108 void
1109 glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat,
1110                         GLsizei width, GLsizei height, GLsizei depth,
1111                         GLint border, GLsizei imageSize, const GLvoid *data)
1112 {
1113         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1114
1115         GLWRAP_DEFER (glCompressedTexImage3D, target, level, internalformat,
1116                       width, height, depth, border, imageSize, data);
1117 }
1118
1119 void
1120 glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat,
1121                            GLsizei width, GLsizei height, GLsizei depth,
1122                            GLint border, GLsizei imageSize, const GLvoid *data)
1123 {
1124         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1125
1126         GLWRAP_DEFER (glCompressedTexImage3DARB, target, level, internalformat,
1127                       width, height, depth, border, imageSize, data);
1128 }
1129
1130 void
1131 glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset,
1132                            GLsizei width, GLenum format, GLsizei imageSize,
1133                            const GLvoid *data)
1134 {
1135         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1136
1137         GLWRAP_DEFER (glCompressedTexSubImage1D, target, level, xoffset,
1138                       width, format, imageSize, data);
1139 }
1140
1141 void
1142 glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset,
1143                               GLsizei width, GLenum format, GLsizei imageSize,
1144                               const GLvoid *data)
1145 {
1146         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1147
1148         GLWRAP_DEFER (glCompressedTexSubImage1DARB, target, level, xoffset,
1149                       width, format, imageSize, data);
1150 }
1151
1152 void
1153 glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset,
1154                            GLint yoffset, GLsizei width, GLsizei height,
1155                            GLenum format, GLsizei imageSize, const GLvoid *data)
1156 {
1157         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1158
1159         GLWRAP_DEFER (glCompressedTexSubImage2D, target, level, xoffset,
1160                       yoffset, width, height, format, imageSize, data);
1161 }
1162
1163 void
1164 glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset,
1165                               GLint yoffset, GLsizei width, GLsizei height,
1166                               GLenum format, GLsizei imageSize,
1167                               const GLvoid *data)
1168 {
1169         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1170
1171         GLWRAP_DEFER (glCompressedTexSubImage2DARB, target, level, xoffset,
1172                       yoffset, width, height, format, imageSize, data);
1173 }
1174
1175 void
1176 glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset,
1177                            GLint yoffset, GLint zoffset, GLsizei width,
1178                            GLsizei height, GLsizei depth, GLenum format,
1179                            GLsizei imageSize, const GLvoid *data)
1180 {
1181         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1182
1183         GLWRAP_DEFER (glCompressedTexSubImage3D, target, level, xoffset,
1184                       yoffset, zoffset, width, height, depth, format,
1185                       imageSize, data);
1186 }
1187
1188 void
1189 glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset,
1190                               GLint yoffset, GLint zoffset, GLsizei width,
1191                               GLsizei height, GLsizei depth, GLenum format,
1192                               GLsizei imageSize, const GLvoid *data)
1193 {
1194         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1195
1196         GLWRAP_DEFER (glCompressedTexSubImage3DARB, target, level, xoffset,
1197                       yoffset, zoffset, width, height, depth, format,
1198                       imageSize, data);
1199 }
1200
1201 void
1202 glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level,
1203                                GLenum internalformat, GLsizei width,
1204                                GLint border, GLsizei imageSize,
1205                                const GLvoid *bits)
1206 {
1207         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1208
1209         GLWRAP_DEFER (glCompressedTextureImage1DEXT, texture, target, level,
1210                       internalformat, width, border, imageSize, bits);
1211 }
1212
1213 void
1214 glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level,
1215                                GLenum internalformat, GLsizei width,
1216                                GLsizei height, GLint border,
1217                                GLsizei imageSize, const GLvoid *bits)
1218 {
1219         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1220
1221         GLWRAP_DEFER (glCompressedTextureImage2DEXT, texture, target, level,
1222                       internalformat, width, height, border, imageSize, bits);
1223 }
1224
1225 void
1226 glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level,
1227                                GLenum internalformat, GLsizei width,
1228                                GLsizei height, GLsizei depth, GLint border,
1229                                GLsizei imageSize, const GLvoid *bits)
1230 {
1231         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1232
1233         GLWRAP_DEFER (glCompressedTextureImage3DEXT, texture, target,
1234                       level, internalformat, width, height, depth,
1235                       border, imageSize, bits);
1236 }
1237
1238 void
1239 glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level,
1240                                   GLint xoffset, GLsizei width, GLenum format,
1241                                   GLsizei imageSize, const GLvoid *bits)
1242 {
1243         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1244
1245         GLWRAP_DEFER (glCompressedTextureSubImage1DEXT, texture, target,
1246                       level, xoffset, width, format, imageSize, bits);
1247 }
1248
1249 void
1250 glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level,
1251                                   GLint xoffset, GLint yoffset, GLsizei width,
1252                                   GLsizei height, GLenum format,
1253                                   GLsizei imageSize, const GLvoid *bits)
1254 {
1255         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1256
1257         GLWRAP_DEFER (glCompressedTextureSubImage2DEXT, texture, target, level,
1258                       xoffset, yoffset, width, height, format, imageSize, bits);
1259 }
1260
1261 void
1262 glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level,
1263                                   GLint xoffset, GLint yoffset, GLint zoffset,
1264                                   GLsizei width, GLsizei height, GLsizei depth,
1265                                   GLenum format, GLsizei imageSize,
1266                                   const GLvoid *bits)
1267 {
1268         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1269
1270         GLWRAP_DEFER (glCompressedTextureSubImage3DEXT, texture, target,
1271                       level, xoffset, yoffset, zoffset, width, height,
1272                       depth, format, imageSize, bits);
1273 }
1274
1275 void
1276 glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
1277                       GLenum internalformat, GLsizei width, GLint border,
1278                       GLenum format, GLenum type, const GLvoid *pixels)
1279 {
1280         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1281
1282         GLWRAP_DEFER (glMultiTexImage1DEXT, texunit, target, level,
1283                       internalformat, width, border, format, type, pixels);
1284 }
1285
1286 void
1287 glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
1288                       GLenum internalformat, GLsizei width, GLsizei height,
1289                       GLint border, GLenum format, GLenum type,
1290                       const GLvoid *pixels)
1291 {
1292         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1293
1294         GLWRAP_DEFER (glMultiTexImage2DEXT, texunit, target, level,
1295                       internalformat, width, height, border, format,
1296                       type, pixels);
1297 }
1298
1299 void
1300 glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
1301                       GLenum internalformat, GLsizei width, GLsizei height,
1302                       GLsizei depth, GLint border, GLenum format,
1303                       GLenum type, const GLvoid *pixels)
1304 {
1305         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1306
1307         GLWRAP_DEFER (glMultiTexImage3DEXT, texunit, target, level,
1308                       internalformat, width, height, depth, border,
1309                       format, type, pixels);
1310 }
1311
1312 void
1313 glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
1314                          GLint xoffset, GLsizei width, GLenum format,
1315                          GLenum type, const GLvoid *pixels)
1316 {
1317         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1318
1319         GLWRAP_DEFER (glMultiTexSubImage1DEXT, texunit, target, level,
1320                       xoffset, width, format, type, pixels);
1321 }
1322
1323 void
1324 glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
1325                          GLint xoffset, GLint yoffset, GLsizei width,
1326                          GLsizei height, GLenum format, GLenum type,
1327                          const GLvoid *pixels)
1328 {
1329         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1330
1331         GLWRAP_DEFER (glMultiTexSubImage2DEXT, texunit, target, level, xoffset,
1332                       yoffset, width, height, format, type, pixels);
1333 }
1334
1335 void
1336 glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
1337                          GLint xoffset, GLint yoffset, GLint zoffset,
1338                          GLsizei width, GLsizei height, GLsizei depth,
1339                          GLenum format, GLenum type, const GLvoid *pixels)
1340 {
1341         SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1342
1343         GLWRAP_DEFER (glMultiTexSubImage3DEXT, texunit, target, level,
1344                       xoffset, yoffset, zoffset, width, height, depth,
1345                       format, type, pixels);
1346 }